Code Monkey home page Code Monkey logo

librarian's Introduction

Librarian

Manage Koikatsu projects by managing the movement of Koikatsu UserData folders.

Installation

Setup virtual environment and install repository:

pip install git+https://github.com/pain-text-format/librarian.git

Setup

Configure the Librarian to work with the UserData file between the Koikatsu game directory and some [library] directory of choice.

librarian --library [library-path] --workspace [koikatsu-path]

For example:

librarian --library ./my_library --workspace "C:/Program Files/Koikatsu Party"

Librarian data is stored in .librarian.yaml.

Usage

Copy the UserData game folder to $LIBRARY/hello-world/UserData.

librarian create hello-world

This creates the following folder structure:

- $LIBRARY
    - hello-world
        - UserData
            - audio
            - bg
            - cap
            - ...
        - .studio_project

The folder hello-world is called a 'project'. Notice it contains a .studio_project file. By definition, any folder in the library that directly contains such a file is considered a project.

This library project is now assigned to the game directory, a.k.a the workspace. At most one project can be assigned to the workspace at any given time. A workspace can have no projects assigned. Assignment allows the user to perform push or pull actions: syncing features described below.

When a new project is created (e.g. librarian create hello-universe), the Librarian will unassign hello-world and assign hello-universe. To see which project is currently assigned to the workspace, execute

librarian

List all projects:

librarian list
# Retrieved Librarian data.
# -----
# - project-1
# - project-2
# - ...
# -----

To assign a different project, execute

librarian assign [project-name]

Features

  • Wildcarding is supported with the -p flag (e.g. librarian list -p hello-* or librarian delete -p hello-*)
  • Folder structure is supported (e.g. librarian create path/to/project-name)

Delete a project:

librarian delete --name [project-name]

Load a project:

librarian load [project-name]

Synchronize with Assigned Project

The following commands work only if a project is assigned to the workspace.

Push and Pull

Copy an updated UserData folder from the game directory to the assigned project location with

librarian push

This will delete the UserData folder in the assigned project directory.

Similarly, load the UserData folder from the assigned project directory to the game directory with

librarian pull

Sync

Synchronize files in the UserData folder so that they are equal between workspace and library:

librarian sync

Applications

You may have multiple projects organized like so:

- $LIBRARY
    - genre-1
        - story-1
            - chapter-1
                - UserData
                - .studio_project
            - chapter-2
                - UserData
                - .studio_project
            - ...
    - genre-2
        ...
    - gallery
        - theme-1

View projects within a scope with librarian list:

librarian list -p genre-1/*
# response
# ------
# - genre-1\story-1\chapter-1
# - genre-1\story-1\chapter-2
# - ...

Save your workspace to the assigned project with librarian push, then load another ongoing project:

librarian load genre-1/story-1/chapter-1

librarian's People

Contributors

psilabs-dev avatar

librarian's Issues

inferred project name for assignment

Folder-based project names are usually too long:

librarian list
# -----
# - path/to/very/long/folder/project-name

It would be annoying to write this when changing projects.

librarian assign path/to/very/long/folder/project-name
# OK

The base name should be as effective as the project name.

librarian assign project-name
# Also OK

Usually this is not unique, so add options if that is the case.

librarian assign project-name
# conflict detected, which project to assign?
# [1] series-1/project-name
# [2] series-2/project-name
# Select: _

Additionally wildcards should also be supported.

librarian assign hello*project-name
# confirm assign to "hello-world/project-name"? _

or in case of conflict

librarian assign hello*project-name
# select a project to assign:
# [1] hello-world/project-name
# [2] hello-me/project-name
# Select: _

CLI implementation

instead of

librarian create [project-name]

can use (in a CLI)

create [project-name]

and so on...

move/rename library project

librarian move [old-project] [new-project]

cases

librarian move [project] [project] -> OK/do nothing
librarian move hello hello/world -> OK
librarian move [project] [existing-project] -> error
librarian move [project] [invalid-project] -> error
librarian move [invalid-project] [any] -> error

Implement sync

Add "last sync time"

Capture states of both src and dest (path/mtime pair) save somewhere in librarian

Track added/deleted/modified/unmodified files in both src and dest

Integrate kksubs

a studio project determines the kksubs projects that fall under it.

Something like this, in a workspace (not kkt game folder) powered with librarian and kksubs:

- library
  - folder-1
    - default
      - UserData
      - .studio_project/kksubs
        - drafts
        - ...
    - project-1
      - UserData
      - .studio_project/kksubs
        - drafts
        - ...
    - ...
- librarian.yaml
# currently working-on kksubs project
- drafts
- output
- styles.yaml

quickly switch between userdata projects, and also within a userdata project: switch quickly between subtitle projects using existing librarian tools

Default project

If a folder has project called default calling the folder should call the default project

Eg

librarian list
# - world/default
# - world/project-1
# - world/project-2

Then the assignment below will work.

librarian assign world #OK

(distribute is more appropriate since transfer implies movement of source)

librarian distribute --source [source-project] --destination [destination-projects] --folder [folders]

distributes data from source folder(s) to destination(s)
Source supports selecting parent directory
Destination supports wildcard syntax

librarian import [source] --folder [folders]

imports data from a source to the workspace (without deleting the destination folders); equivalent to

librarian distribute --source [source-project] --destination current-workspace --folder [folders]

e.g.

librarian distribute --source hello/world --destination world* --folder cap chara studio
# copies contents of cap, chara, and studio from hello/world to all hello/world* projects

Adds a distribute configuration to the librarian, which will override in absence of folder argument.

(either distribute or transfer)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.