Use LLMs to help you write your things.
Project description
Write A Thing
Use LLMs to help you write your things.
Developer:
- Dan Saattrup Nielsen (dan.nielsen@alexandra.dk)
Setup
Installation
- Run
make install, which sets up a virtual environment and all Python dependencies therein. - Run
source .venv/bin/activateto activate the virtual environment. - (Optional) Run
make install-pre-commit, which installs pre-commit hooks for linting, formatting and type checking.
Adding and Removing Packages
To install new PyPI packages, run:
uv add <package-name>
To remove them again, run:
uv remove <package-name>
To show all installed packages, run:
uv pip list
All Built-in Commands
The project includes the following convenience commands:
make install: Install the project and its dependencies in a virtual environment.make install-pre-commit: Install pre-commit hooks for linting, formatting and type checking.make lint: Lint the code usingruff.make format: Format the code usingruff.make type-check: Type check the code usingmypy.make test: Run tests usingpytestand update the coverage badge in the readme.make docker: Build a Docker image and run the Docker container.make docs: View documentation locally in a browser.make publish-docs: Publish documentation to GitHub Pages.make tree: Show the project structure as a tree.
A Word on Modules and Scripts
In the src directory there are two subdirectories, write_a_thing
and scripts. This is a brief explanation of the differences between the two.
Modules
All Python files in the write_a_thing directory are modules
internal to the project package. Examples here could be a general data loading script,
a definition of a model, or a training function. Think of modules as all the building
blocks of a project.
When a module is importing functions/classes from other modules we use the relative import notation - here's an example:
from .other_module import some_function
Scripts
Python files in the scripts folder are scripts, which are short code snippets that
are external to the project package, and which is meant to actually run the code. As
such, only scripts will be called from the terminal. An analogy here is that the
internal numpy code are all modules, but the Python code you write where you import
some numpy functions and actually run them, that a script.
When importing module functions/classes when you're in a script, you do it like you would normally import from any other package:
from write_a_thing import some_function
Note that this is also how we import functions/classes in tests, since each test Python file is also a Python script, rather than a module.
Features
Docker Setup
A Dockerfile is included in the new repositories, which by default runs
src/scripts/main.py. You can build the Docker image and run the Docker container by
running make docker.
Automatic Documentation
Run make docs to create the documentation in the docs folder, which is based on
your docstrings in your code. You can publish this documentation to Github Pages by
running make publish-docs. To add more manual documentation pages, simply add more
Markdown files to the docs directory; this will automatically be included in the
documentation.
Automatic Test Coverage Calculation
Run make test to test your code, which also updates the "coverage badge" in the
README, showing you how much of your code base that is currently being tested.
Continuous Integration
Github CI pipelines are included in the repo, running all the tests in the tests
directory, as well as building online documentation, if Github Pages has been enabled
for the repository (can be enabled on Github in the repository settings).
Code Spaces
Code Spaces is a new feature on Github, that allows you to develop on a project
completely in the cloud, without having to do any local setup at all. This repo comes
included with a configuration file for running code spaces on Github. When hosted on
alexandrainst/write_a_thing then simply press the <> Code button
and add a code space to get started, which will open a VSCode window directly in your
browser.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file write_a_thing-0.1.0.tar.gz.
File metadata
- Download URL: write_a_thing-0.1.0.tar.gz
- Upload date:
- Size: 180.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3076a81ada889e4e9b4d14ef658a7c649d40b44dd9f270131fc60e3ebe58bfe
|
|
| MD5 |
9187f3359e8af8cc51ff37367ac0cb62
|
|
| BLAKE2b-256 |
bd0f32bd3bacca102039991f11d436ad70cb066001173980a986f22eb4f4565f
|
File details
Details for the file write_a_thing-0.1.0-py3-none-any.whl.
File metadata
- Download URL: write_a_thing-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d841f260256235c3807eb38cecdd468ad29a761a486473eeb018baf20b512f85
|
|
| MD5 |
875036b069fee2e6045267198bbf9def
|
|
| BLAKE2b-256 |
e220c42a0405e37b242115e159d33a042eba44607c4cd06de5b72532538c2c8c
|