Skip to main content

ocflib

Build Status Coverage Status PyPI version

ocflib is a Python library for working with Open Computing Facility services (in particular, accounts and server management).

The library targets Python 3.5.3 and 3.7 (the versions available in Debian stretch and buster).

The goal of the library is to make it easier to re-use OCF python code. In the past, code was split between approve, atool, create, chpass, sorry, signat, etc., which made it difficult to do things like share common password requirements.

What belongs here

In general, code which can be re-used should be here, but standalone applications or binaries shouldn't. For example, ocfweb uses ocflib code to change passwords and create accounts, but the Django web app doesn't belong here.

Using on OCF

ocflib is installed by Puppet on the OCF, so you can simply do things like import ocflib.lab.stats from the system python3 installation. We don't install it to python2 site-packages.

We build a Debian package which is installed by Puppet. We also publish new versions to PyPI, which is useful because it allows easy installation into virtualenvs.

Note about lockfiles

This repository includes a poetry.lock file. Lockfiles are usually used to ensure that the exact same versions of dependencies are installed across different machines. However, as this is a library, we don't want to force downstream users to use the exact same versions of dependencies as us, and indeed, the lockfile is ignored when distributing. We still include it in the repository to make it easier to develop, test, and debug ocflib.

Installing locally

For Testing Changes

Development of ocflib uses Poetry. The easiest way to test changes to ocflib is to let Poetry manage the virtual environment for you:

poetry install
poetry shell

Now, if you import something from ocflib, you'll be using the version from your working copy.

Testing and linting

We use pytest to test our code, and pre-commit to lint it. You should run make test before pushing to run both.

The tests directory contains automated tests which you're encouraged to add to (and not break). The tests-manual directory contains scripts intended for testing.

Using pre-commit

We use pre-commit to lint our code before commiting. While some of the rules might seem a little arbitrary, it helps keep the style consistent, and ensure annoying things like trailing whitespace don't creep in.

You can simply run make install-hooks to install the necessary git hooks; once installed, pre-commit will run every time you commit.

Alternatively, if you'd rather not install any hooks, you can simply use make test as usual, which will also run the hooks.

Deploying changes

Deploying changes involves:

  • Running tests and linters
  • Pushing a new version to PyPI
  • Building a Debian package
  • Pushing the Debian package to our internal apt

Jenkins will automatically perform all of these steps for you on every push, including automatically generating a new version number. As long as make test passes, your code will be automatically deployed. You can monitor the progress of your deploy here.

Release files for ocflib 2026.9.23.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocflib 2026.9.23.post1
File Size Uploaded
ocflib-2026.9.23.post1.tar.gz 66.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ocflib 2026.9.23.post1
File Interpreter ABI Platform
ocflib-2026.9.23.post1-py3-none-any.whl Python 3 none any Details

Total release size: 148.1 kB

Release files / ocflib-2026.9.23.post1.tar.gz

Download URL ocflib-2026.9.23.post1.tar.gz
Size 66.8 kB
Tags Source
SHA-256 checksum
How to use checksums
06dec6e0d708e9a38cabc6acbd2a7e2ecbb41670f14a3ce8935ef1cafbb72dcb
BLAKE2b-256 checksum
How to use checksums
60f87242339203bd2162514d277a36b41978df187ff7f0bd8a108de95f7bdf25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / ocflib-2026.9.23.post1-py3-none-any.whl

Download URL ocflib-2026.9.23.post1-py3-none-any.whl
Size 81.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
385f1bde19dcda51dde7511f92936d3c4c7b385a313fb67db83ade8654e63a98
BLAKE2b-256 checksum
How to use checksums
7c4b6a433d828e3af4d29146c83f487f2a9f7f22f2ee43c21c6bfcb716595a1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.9.23.post1 This release

2 release files

31

1 release file

30

1 release file

29

1 release file

28

1 release file

27

1 release file

26

1 release file

25

1 release file

24

1 release file

23

1 release file

22

1 release file

21

1 release file

20

1 release file

19

1 release file

18

1 release file

17

1 release file

16

1 release file

15

1 release file

14

1 release file

13

1 release file

12

1 release file

11

1 release file

10

1 release file

9

1 release file

8

1 release file

7

1 release file

6

1 release file

5

1 release file

4

1 release file

3

1 release file

1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page