Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

onecode_logo

GitHub release PyPI - License PyPI - Python Version GitHub Workflow Status Windows supported Linux supported MacOS supported Maintainability Coverage


OneCode 2 is for the new OneCode Cloud. An app is a single main.py: flows, .onecode.json and onecode_ext are gone. Apps for the legacy OneCode Cloud stay on 1.3.x, which receives security fixes until 30 June 2027 (see SECURITY.md). See Upgrading from 1.x.

OneCode, your gateway to Python application deployment on the Cloud!

🐍 OneCode in One Minute

Create your first OneCode app

With uv:

uvx --from onecode onecode-create "Hello World"

⠋ Creating new OneCode project
✅ Created Hello World OneCode project in ./Hello_World

This creates the app in a new Hello_World folder:

Hello_World/
├── main.py             # your app
├── requirements.txt    # the packages it needs, starting with onecode>=2,<3
├── data/               # input data, and outputs under data/outputs/
├── README.md
├── LICENSE
└── .gitignore

Write your app

Your code goes in the run() function of main.py. Replace hard-coded values with OneCode Elements, here a text input:

import onecode


def run():
    name = onecode.text_input("name", "World", label="Your name")
    onecode.Logger.info(f"Hello {name}!")


if __name__ == "__main__":
    onecode.main(run)

Keep the last two lines: onecode.main(run) is what runs the app. Bigger apps add modules or packages next to main.py and import them as usual.

onecode-extract and onecode-build read the elements without running the app, so write their arguments in the call: values, onecode and its enums such as FileFilter.CSV, or os. An argument that names a variable of the app stops them with an error.

Run your app

cd Hello_World
uv venv
uv pip install -r requirements.txt
uv run python main.py

# You should see the following printed
2026-11-29 10:00:00,000 [INFO] main.py:6 - Hello World!

The text input takes World by default, and any other value without changing the code:

uv run onecode-extract params.json   # writes {"name": "World"}: edit it
uv run python main.py params.json

🎉 Congratulations, you now are a OneCoder! 🎉

🌋 Deploy on OneCode Cloud

  1. Push your app to a GitHub repository.
  2. Register the app on OneCode Cloud with Register app, and pick the repository and branch.
  3. OneCode Cloud builds it: it installs requirements.txt, then runs onecode-build to turn your input elements into the app's run form.
  4. Each run is python main.py params.json with the values entered in the form. Files written with file_output() are the run's results.

Each new commit pushed to the registered branch triggers a new build.

🚀 Getting Started with the OneCode API

OneCode relies on the following principles:

  • no-disruption: OneCode doesn't force you to change the way you code. No matter what your code structure and Python files hierarchy, OneCode can seamlessly be integrated with it.

  • controllable input parameters: simply replace your hard-coded parameters with OneCode functions (called Elements) so that their value can change without having to change the code. One Code, many ways to run!

  • automated interface: OneCode push on the cloud, the interface will automatically be generated from the OneCode Elements

  • easy deployment: no need to change the code between your local machine and the cloud. Simply push your code as-is on your synchronized GitHub account and your App (environment and UI!) will build automatically!

The most important part of the API are Input and Output Elements. They can be inlined within your code or not, that's up to you (no-disruption!), see examples below:

  • use Input Elements whenever you need to expose a parameter with a specific widget. For example:
# instead of: df = pd.read_csv('test.csv')
df = csv_reader('your df', 'test.csv')

# instead of: for i in range(5):
for i in range(slider('N', 5, min=0, max=10)):  # inlined
    # do stuff

# instead of: choice = 'cat'
choice = dropdown('your choice', 'cat', options=['dog', 'cat', 'fish']) # not inlined
Logger.info(f'Your choice is {choice}')
# instead of: plt.savefig('stuff.png')
plt.savefig(file_output('stuff', 'stuff.png'))  # inlined

# instead of: filepath = 'test.txt'
filepath = file_output('test', 'test.txt')  # not inlined
with open(filepath, 'w') as f:
    # do stuff

Check out the full API documentation here!

⬆️ Upgrading from 1.x

An app with one flow (the usual case) moves in a few steps:

  1. Move the body of flows/<id>.py into main.py, keep def run(), and end the file with:
    if __name__ == "__main__":
        onecode.main(run)
    
  2. Move helper modules out of flows/, next to main.py or into a package, and turn relative imports such as from .utils import x into from utils import x.
  3. Delete .onecode.json, flows/ and any flows/onecode_ext/.
  4. In requirements.txt, change onecode>=1,<2 to onecode>=2,<3.
  5. Drop reads of Project().current_flow. Code that opens outputs/<flow>/MANIFEST.txt itself now opens outputs/MANIFEST.txt.

Element keys, parameters files, the data/ layout and file_output() paths do not change, so saved parameters keep working. An element whose arguments cannot be read, such as one that names a variable of the app, now stops onecode-extract and onecode-build: 1.x left it out of the parameters and the run form. The OneCode 2 CLIs stop with 1.x project: pin onecode<2 when they find a .onecode.json.

python main.py no longer takes --flow or --flush. onecode-add, onecode-start, onecode-zip and onecode-check are removed. See the 2.0.0 changelog for the full list.

🚧 Work in Progress

As onecode is still transitioning to OneCode Cloud, early versions of the OneCode Cloud don't yet support completely the following features:

  • Folder Inputs: as the cloud doesn't really have directory structures, it needs some special work. In the meantime, replace with multiple selection file_input instead.

  • Dynamic options: dynamic expressions in options of the dropdown element) is not fully supported yet. You can still use it, in that case, the elements will ask user to fill out values as regular text input (e.g. CSV column names, etc.).

  • Dynamic optional: optional as True/False (static) works as expected, however dynamnic expressions will be ignored for now. As a consequence, hide_when_disabled attribute is obsolete until dynamic optional are supported again.

  • Attribute count: we go back-and-forth with this one on bringing this one to the Cloud. In the meantime, switch back to non-dynamic elements, e.g. multiple dropdown, text input collecting list of values, etc.

🛠️ Developing OneCode

The library itself is a uv project: pyproject.toml is a standard [project] table and uv.lock pins the development environment.

uv sync                                   # library, tests and ruff in .venv
uv run pytest tests -n auto
uv run ruff check .
uv run --group docs mkdocs serve          # documentation

A release is published by creating a GitHub release whose tag is the version in pyproject.toml (and onecode.__version__), e.g. 2.0.0. The publish workflow builds it and uploads it to PyPI with attestations.

👋 Getting Help

Security reports go through private vulnerability reporting. See SECURITY.md. Security fixes are published for the latest 2.x release, and for the 1.3.x line until 30 June 2027.

Issues labeled cra-vulnerability come from the dependency scan. They are not the place to disclose a new flaw.

If you are a OneCode customer, you may directly email our support team. Feel free as well to browse the GitHub Issues and reach out to the community by posting bug reports, questions and suggestions.

Metadata

Release files for onecode 2.0.0rc3

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

Source distribution (sdist)

Source distribution for onecode 2.0.0rc3
File Size Uploaded Provenance Actions
onecode-2.0.0rc3.tar.gz 62.2 kB With provenance Details for onecode-2.0.0rc3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for onecode 2.0.0rc3
File Interpreter ABI Platform Actions
onecode-2.0.0rc3-py3-none-any.whl Python 3 none any Details for onecode-2.0.0rc3-py3-none-any.whl

Total release size: 164.7 kB

Release files / onecode-2.0.0rc3.tar.gz

Download URL onecode-2.0.0rc3.tar.gz
Size 62.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bf232f121f2e90390fc5901efdd56421af43ffb24e4a3034801bc9d2d711d45d
BLAKE2b-256 checksum
How to use checksums
ce42a5858a5c3dd448e92d4fab50223d5a7d7b6998169ad170d623dea651b2f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

Release files / onecode-2.0.0rc3-py3-none-any.whl

Download URL onecode-2.0.0rc3-py3-none-any.whl
Size 102.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc647b8e377fec734c6b28fc5b33cfcb8b2f9eeae0f92a6f78d2de84947c2d51
BLAKE2b-256 checksum
How to use checksums
a062b06760ab0b2fd8acceaaa38b1ac7f840b7c29ed536a70618527b471c0fb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

Security for onecode 2.0.0rc3

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for onecode-2.0.0rc3.tar.gz

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 Nov 30, 2026.

Transparency log

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.

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