Rain
š§ļø A live example to illustrate python packaging, testing, building, & deploying
Install / Use
/learn @ankur-gupta/RainREADME
š§ļø rain
A live example to illustrate python packaging, testing, building, & deploying
Updates
rain has been updated to version 2
- Uses the new
srcdirectory structure for python prokects - Uses the new
pyproject.tomlmetadata structure based on PEP 621 - More informative tests than version 1.0.0
- More informative names than version 1.0.0
- Python 2 cruft has been removed
- Main branch renamed from
mastertomain - Uses hatch to run tests, build packages, and update versions
- You can still access v1 code and README here
Aims
rain is an online reference that can be explored by
humans. It provides a living, dynamic alternative to commonly available
static documentation. This repository covers
the following topics.
- file and directory type modules
- selective imports from a directory-type module
- local/relative imports
- circular imports
- storing, using, and distributing data files
- entry point CLI scripts
- setup logging inside a package
- storing version information in one location
- specifying dependencies
- running and skipping tests
- obtaining coverage metrics & uploading them to codecov.io
- building and installing this package locally
- example CI/CD using GitHub Actions
- adding badges to your README
- deploying to PyPI (explained but not demo'd)
rain is a live and unencumbered reference that aims to educate not execute.
Online reference
rain uses hatch to build package, run tests, update version, and more.
If you want to create an empty scaffold for a new package you should use
hatch new my-project. rain provides an online reference you can peruse to
learn about the topics mentioned above.
Learn by examples
You can find all the details in a written, textual documentation. But, if you don't want to read the documentation
and instead want to see a living example, try rain.
Less code to browse through
You can find examples in any of the famous packages such as numpy but you'll have to browse through a lot of
complexity. rain provides a small code base that is only sufficient to explain python packaging.
Learn one topic at a time
Most of the topics above are explained in individual modules and files. For example,
circular_imports module only deals with
circular imports without having to deal with other issues such as logging.
Tests and builds via GitHub Actions
CI/CD is often best explained via live, working examples instead of written textual documentation.
Clone/fork and experiment
Clone or fork rain to quickly test out something without having to write a new package from scratch or messing your
own important package.
Directory Structure
.
āāā LICENSE
āāā README.md
āāā pyproject.toml
āāā src
ā āāā rain
ā āāā __init__.py
ā āāā circular_imports
ā ā āāā __init__.py
ā ā āāā array.py
ā ā āāā grouped_array.py
ā āāā cli
ā ā āāā __init__.py
ā ā āāā rain_maker.py
ā āāā directory_module_with_selective_imports
ā ā āāā __init__.py
ā ā āāā main.py
ā ā āāā utils.py
ā āāā local_imports
ā ā āāā __init__.py
ā ā āāā main.py
ā ā āāā variables.py
ā āāā logging_example
ā ā āāā __init__.py
ā ā āāā main.py
ā āāā resources
ā ā āāā mathematicians.txt
ā āāā this_directory_is_a_module
ā ā āāā __init__.py
ā ā āāā this_file_is_a_submodule.py
ā āāā this_file_is_a_module.py
ā āāā version.py
āāā tests
āāā __init__.py
āāā not_a_test_file.py
āāā test_a_function_in_a_module.py
āāā test_a_function_in_a_submodule.py
āāā test_circular_imports.py
āāā test_demo_use_of_local_imports.py
āāā test_errors.py
āāā test_how_to_import_from_package.py
āāā test_markers.py
āāā test_naming_conventions.py
āāā test_root.py
āāā test_this_function_will_be_imported.py
āāā test_using_a_class.py
āāā test_version.py
License
Contributing
Contributions are welcome. If you find errors or identify need for improvement, please look into Issues and open an issue.
Related Skills
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
109.8kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
349.9kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
