Giter Site home page Giter Site logo

janpipek / pyvec.org Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pyvec/pyvec.org

0.0 2.0 0.0 16.11 MB

Website of Pyvec nonprofit / Webová stránka neziskovky Pyvec

Home Page: https://pyvec.org

License: MIT License

Python 44.52% CSS 15.66% HTML 39.71% Shell 0.11%

pyvec.org's Introduction

pyvec.org

Pyvec homepage.

Installation

The code is Python 3.7

$ pipenv install

Development

The site uses elsa.

  • Installation: pipenv install --dev
  • Download data from external sources: pipenv run build
  • Tests: pipenv run test
  • Development server: pipenv run serve

Data and tests

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.

External sources

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.

Members

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.

Numbers

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,

  1. ask him to run the script,
  2. bother him to Open Source the script code.

Google Drive credentials

  1. Follow the steps in the gspread guide. Instead of Google Drive API, enable Google Sheets API.
  2. Save the obtained JSON file into the pyvecorg package as google_service_account.json
  3. Make sure it is ignored by Git
  4. Run cat pyvecorg/google_service_account.json | pbcopy to copy the JSON into your clipboard (macOS)
  5. Go to settings of secrets
  6. Add GOOGLE_SERVICE_ACCOUNT secret and paste the JSON from your clipboard as a value

Deployment

The site uses elsa. It gets automatically deployed after any push to the master branch.

License

MIT

pyvec.org's People

Contributors

honzajavorek avatar dependabot-preview[bot] avatar encukou avatar dependabot-support avatar hroncok avatar benabraham avatar sairon avatar kvbik avatar janpipek avatar

Watchers

James Cloos avatar  avatar

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.