1.x is in maintenance. 1.3.0 is the last 1.x feature release and the last one for the legacy OneCode Cloud. The 1.3.x line receives security fixes only, until 30 June 2027. See SECURITY.md.
OneCode, your gateway to Python application deployment on the Cloud! Pssst, if you're not into rolling out your App but simply using them, check out the OneCode Cloud user doc.
- OneCode in One Minute
- Deploy on OneCode Cloud
- Getting Started with the OneCode API
- Upgrading from 0.x
- Work in Progress
- Getting Help
🐍 OneCode in One Minute
Install OneCode
pip install onecode
Create your first OneCode project
onecode-create
# then follow the prompts
? Enter the path where to create OneCode project: ~/
? Enter your OneCode project name: HelloWorld
⠋ Creating new OneCode project
✅ Created HelloWorld OneCode project
Add your first OneCode Element
Edit the file HelloWorld/flows/helloworld.py such as
from onecode import Logger, text_input
def run():
Logger.info(f"Hello {text_input('your name', 'OneCoder')}!")
Running your OneCode project
cd HelloWorld
python main.py
# You should see the following printed
[INFO] helloworld - |OneCode|.helloworld.py:5 - Hello OneCoder!
By default, the OneCode text input is OneCoder but now can take any other values without having to change the code.
🎉 Congratulations, you now are a OneCoder! 🎉
🌋 Deploy on OneCode Cloud
The following steps will show you how to get setup for the 1st time:
-
Ensure you install at least
onecode >= 1.0.0and have a GitHub account- If you have an app with a previous
onecodeversion, upgrade from 0.x. - Create your OneCode App (or use an existing one) and push it to your GitHub account.
- If you have an app with a previous
-
Request a beta-tester access here.
-
Once you received your confirmation email, login on onecode.rocks.
-
Register your first app
- From the dashboard, navigate to Apps in the top menubar.
- Click on Register New App.
- On your first visit, you'll need to Link GitHub Account to your OneCode account.
- As you are redirected to GitHub, login to your GitHub account.
- Authorize OneCode.
-
Upon authorization, you will be redirected back to OneCode with your GitHub identity. You now need to decide which repositories OneCode may access in order to build your app by clicking on GitHub App.
-
Choose which repositories should be accessible by OneCode. Note that you can change these permissions at anytime.
- Select the repository and the branch corresponding to the OneCode App you want to deploy. Choose if needed a different image and Python version than the default one.
-
The App will then appear in your personal Apps Workspace and be automatically built. Each new commit that you push to the registered branch will automatically trigger a new build
🎉 🎉 🎉 Congratulations, you now are an Cloud OneCoder! 🎉 🎉 🎉
🚀 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}')
- use Output Elements whenever an output should be returned. For example:
# 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 0.x
-
Ensure there is
requirements.txtfile at the root of your App and that it contains at leastonecode>=1,<2. -
Change all Output Elements (e.g.
image_output(),text_output(), etc.) to simplyfile_output(). -
Remove any
section_header()element. -
Check out the work in progress section in case you were using advanced features.
🚧 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:
-
Multi-steps: adding more than one flow to your App will eventually be supported. In the meantime, either split your app (one app per step) or merge all steps under a single one (you may directly update the
.onecode.jsonfile or create a new app and move the code to it). -
Folder Inputs: as the cloud doesn't really have directory structures, it needs some special work. In the meantime, replace with multiple selection
file_inputinstead. -
Custom Elements (in custom plugin or
onecode_ext): extra security precautions must be taken to allow custom UI on the Cloud. It has therefore been disabled for now. Replace them with regular elements until the Cloud is ready for them. -
Dynamic
options: dynamic expressions inoptionsof thedropdownelement) 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:optionalasTrue/False(static) works as expected, however dynamnic expressions will be ignored for now. As a consequence,hide_when_disabledattribute is obsolete until dynamicoptionalare 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. -
Running
onecode-start: getting a local UI is in the works, it's a pretty big feature, thanks for your patience on that one.
👋 Getting Help
Security reports go through private vulnerability reporting. See SECURITY.md. Security fixes are published 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 1.3.0
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 |
|---|---|---|---|---|
| onecode-1.3.0.tar.gz | 65.7 kB | Without provenance | Details for onecode-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| onecode-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for onecode-1.3.0-py3-none-any.whl |
Total release size: 172.9 kB
Release files / onecode-1.3.0.tar.gz
| Download URL | onecode-1.3.0.tar.gz |
|---|---|
| Size | 65.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e542772973321d6cd9a158d4664dee512c0a5b1e982225b70273c9522a0fcad
|
|
BLAKE2b-256 checksum How to use checksums |
8eafdbf6668297bb782a9ba699ac66ede3c0a1563a31e4d6251b0886c5d5100c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Pop!_OS","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / onecode-1.3.0-py3-none-any.whl
| Download URL | onecode-1.3.0-py3-none-any.whl |
|---|---|
| Size | 107.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31b9b308a8013f9ad6fb41b451f945378107af57b8b8c2dc9153398a9dfbbbf2
|
|
BLAKE2b-256 checksum How to use checksums |
b09b3abd7b476a3a205f478b59e2ee1444fe94a6640479cf4eb71bcfcc9549d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Pop!_OS","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for onecode 1.3.0
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.