Skip to main content

Converts course material to naucse.python.cz API

Project description

naucse_render

Helper for converting course material in YAML/Markdown/Jupyter to naucse.python.cz JSON API.

Entrypoints

There are two public entrypoints: one for getting general course information; the other for a subset of lessons.

(This separation means the content doesn't need to be rendered to get course info.)

naucse_render.get_course(course_slug, *, path='.', version=None)

naucse_render.get_lessons(lesson_slugs, vars=None, path='.')

The path specifies the local filesystem path to the root of the repository (i.e. parent directory of courses, runs and lessons).

Installation & Usage

You can run naucse_render from the command line:

python -m naucse_render get-course courses/mi-pyt

python -m naucse_render get-lessons beginners/install beginners/venv-setup

By default, data is retreived from the current working directory. Use the --path option to point naucse_render elsewhere.

Tests

To tests, install pipenv, and install dependencies:

$ pipenv install --dev

then run the tests:

$ pipenv run test

License

The code is licensed under the terms of the MIT license, see LICENSE.MIT file for full text. By contributing code to this repository, you agree to have it licensed under the same license.

Changelog

naucse_render 1.2

  • API version 0.1
  • Serial "numbers" are now generated for sessions.
    • Serials are strings (or None). Usually they are numeric (like '1'), and in the source YAML they may be specified as int. But, for example, an appendix could use Roman numerals: i, ii, iii.
    • When a serial is not given in the source YAML explicitly, it is auto-generated as the previous serial plus 1 (or from 1 at the start). Serials specified as str (or None) prevent this auto-generation.
    • For courses with only one session, the serial is not auto-generated.

naucse_render 1.1

  • Make it possible to use data from a YAML file in lesson content
  • Make output the same on Windows as on "Unixy" systems

naucse_render 1.0

  • Source files are always reported as relative paths
  • YAML files are reloaded when they change
  • Added integration tests

naucse_render 0.x

0.x should successfully render courses hosted on naucse.python.cz prior to 2019.

The format of the source files grew organically, so there is no attempt here to document it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

naucse_render-1.2-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file naucse_render-1.2-py3-none-any.whl.

File metadata

  • Download URL: naucse_render-1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

File hashes

Hashes for naucse_render-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cc0bc86e5439e45312fe53e14e49b9209acfb777ff3cad610732c23bcdf5ffaf
MD5 aeb1c479ba569ac644bd37e748d7f256
BLAKE2b-256 d8457da4e72ebbb86eb4ae3545da17e4e5f4ebf7192c68c6073520616daf1e66

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page