This repository serves Python packages of Sources for Wordsiv, a text-generation library.
Source packages are Python packages, so you can simply install them with Pip.
Assuming you have already installed Wordsiv, you can install a Source package like this:
$ pip install https://github.com/tallpauley/wordsiv-source-packages/releases/download/en_wordcount_web-0.1.0/en_wordcount_web-0.1.0-py3-none-any.whl
This source repository contains Python modules with their accompanying meta.json
files:
en_wordcount_trigrams-0.1.0/
├── en_wordcount_trigrams
│ ├── __init__.py
│ └── data
│ └── data.lfs.txt
└── meta.json
These modules are packaged using the Wordsiv CLI, and then uploaded as individual Github Releases.
$ wordsiv package build modules/en_wordcount_trigrams-0.1.0 dist/
$ ls dist/
en_wordcount_trigrams-0.1.0-py3-none-any.whl
en_wordcount_trigrams-0.1.0.tar.gz
Each package contains one module, which exports dicts sources
and meta
.
sources
has the following structure, where source
is a Source object, and default_model_class
is the default model to use with this source.
sources = {
"en_markov_gutenberg": {
"source": MarkovSource(HERE / "data" / "data.lfs.json"),
"default_model_class": MarkovModel,
},
}
This repository uses Git LFS to manage data files. This allows data files to get big without the Git repository itself getting huge.
We use the convention filename.lfs.ext
for data files to make it simple to track these files with Git LFS.
-
If you have Homebrew it's:
$ brew install git-lfs
-
Initialize Git LFS for your user acccount:
$ git lfs install Updated git hooks. Git LFS initialized.
-
When you add a file such as
data.lfs.json
, double check it's being tracked by Git LFS. You willl seeLFS
to the right of the filename:$ git add data.lfs.json $ git lfs status Objects to be committed: data.lfs.json (LFS: 33d72bf) Objects not staged for commit:
-
Now you can commit, push, and pull request as normal!