Choam
Python enviroment manager based around making depedency management, and publication easier.
While Python is a simple langauge all-around, managing dependencies and publication aren't. However, Choam automates this, with easy configuration, and simple commands.
Choam, automating the nooks and crannies of Python.
Warning
Choam is currently in beta. If you are not comfortable with this, then use a different dependency manager in the meantime like poetry.
Installation
$ pip install choam
Snippets
The most useful snippets of Choam
Note: Depending on your system's configurations, Choam might have to be prefixed with
$ python3 -mlike this,$ python3 -m choam <COMMAND>
To create a new project
$ choam new <project_name>
To initialize a project in the current directory
$ choam init <optional: --adapt (adapts the current project to choam's standards)>
Add required dependency
$ choam add <dependency_name>
Install required dependencies of an existing project
$ choam install
Find all required dependencies and update Choam.toml accordingly
$ choam deps
Convert Choam.toml requirements to requirements.txt
$ choam reqs
Setup config files for publication to PyPi according to Choam.toml
$ choam setup
Start publication to PyPi
$ choam publish
Run project entrypoint
$ choam run <filepath_or_script> <optional: --file (to run files instead of scripts)>
Choam.toml quick start
# Choam.toml
[package]
name = "choam"
version = "0.0.0"
description = "Choam is a project manager"
repo = "https://github.com/cowboycodr/choam"
keywords = ["manager"]
So far we've described the package metadata. Including the package name, version, description, and other useful information. This will all be setup when you setup the project with Choam.
Managing dependencies
Managing dependencies with Choam is just as easy as defining the package metadata.
# Choam.toml
[package]
...
[modules]
choam = "*"
The * means it will require the lastest version of the specified module. You can sepcify specific versions if you like: choam = "0.1.18""
Since Choam is in beta, it will sometimes capture unwanted depedencies. To by-pass this behavior define a [modules-ignore] section. Like so:
# Choam.toml
[package]
...
[modules]
...
[modules-ignore]
shutil = "*"
toml is a weird configuration langauge so make sure to include the = "*" after the specified package.
Choam's scripts
To add custom defined scripts to your project all that is required is [script.<YOUR_SCRIPT_NAME>] and a few other parameters. Let's make a format script with python's black, for example.
# Choam.toml
[package]
...
[modules]
...
[modules-ignore]
...
[script.format]
requires = ["black"]
perspective = "${PROJECT}"
command = "${PYTHON} -m black ."
The requires section defines what dependencies are used with the script.
The perspective parameter defines where the script will run relative to the project folder. The ${PROJECT} will run in the project files directory instead of the overall project folder where the Choam.toml, README.md etc. are.
Note: notice how
${PROJECT}is used? When a piece of text is wrapped like${}this means it is a script variable. Choam provides multiple script variables such as${PYTHON}to access the active python interpreter,${CWD}to access the current directory, and${PROJECT}which is the current working directory. With these script variables you can create very useful scripts that work on any machine.
The perspective parameter defines the actual command that will be run.
Combining all of these with script variables you can create dynmaic, cross-platform, useful, scripts available to anyone.
Running the script:
$ choam run format
In result this will format all of your project files
.choam folder
The .choam folder is specifically for storing Choam related resources. For example: if you have a choam script, and you need to pull from a file, for example. You would put the resource in .choam/scripts/<SCRIPT_NAME>/<FILE>
This project is structured with Choam
Metadata
Release files for Choam 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Choam-1.0.2.tar.gz | 11.8 kB | Without provenance | Details for Choam-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Choam-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for Choam-1.0.2-py3-none-any.whl |
Total release size: 25.7 kB
Release files / Choam-1.0.2.tar.gz
| Download URL | Choam-1.0.2.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a598b18c71da1cb8defacb5f3728162f41a4612352701f6ef4254d14bbf83ae
|
|
BLAKE2b-256 checksum How to use checksums |
9b954f77e1a42cf2baa4da698969a70d517820fd1266c64edc811510c25def01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|
Release files / Choam-1.0.2-py3-none-any.whl
| Download URL | Choam-1.0.2-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e8952bdeda3108e13cb6a8712688cea86b8d5b4faea0bc5ee9f233e45a70422
|
|
BLAKE2b-256 checksum How to use checksums |
88bdb2bc0d5f4de7c85d2daf92be9d514be586a3d73c12ba3f01ebf60819531a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|
Security for Choam 1.0.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.