Pyvec homepage.
The code is Python 3.9
$ pipenv install
The site uses elsa.
pipenv install --dev
pipenv run build
pipenv run test
pipenv run serve
The site is just a single HTML page rendered on top of some static data. However, some of the data come from external sources, the data can get quite complex, and most of the texts need to be translated into two languages.
The data is stored in multiple YAML files. When these are read, whenever
an object has just cs
and en
properties, it is treated as a "translated text"
and the property corresponding to a currently selected language becomes
the actual value in place of the object.
To keep the complex structure of the YAML files organized and tested, there are schemas written in JSON Schema (spec). In tests, the YAML files are validated against the schemas. There is also a couple of additional tests to ensure some logical rules which cannot be easily expressed by JSON Schema.
Some data cannot be stored statically in a YAML file. There is a command
pipenv run build
, which downloads them from external sources and generates
respective static YAML files. This is a separate step, which needs to be done
before developing or deploying the site, otherwise it won't work properly.
Pyvec members are tracked in an internal Google Spreadsheet. The future
intention is to have the list of members public, but we're not there yet (GDPR).
So far only board members are being listed publicly. The pipenv run build
command downloads the spreadsheet as CSV and generates the members_list.yml
file. It also downloads and caches avatars.
There are stats numbers in numbers.yml. They are not calculated on the fly, because for many of them it's either complicated or impossible. They need to be updated manually from time to time. Comments in the YAML file should give you guidance on when the last update has happened.
The number of GitHub contributors was calculated by a mighty one-off script made by @honzajavorek, which uses GitHub API as well as it clones and analyzes all relevant repositories. If you need to update the number,
pyvecorg
package as google_service_account.json
cat pyvecorg/google_service_account.json | pbcopy
to copy the JSON into your clipboard (macOS)GOOGLE_SERVICE_ACCOUNT
secret and paste the JSON from your clipboard as a valueThe site uses elsa. It gets automatically deployed
after any push to the master
branch.