Skip to main content

cff-from-621

This tool derives a CITATION.cff file from a Python project's pyproject.toml contents that provide PEP-621 compliant package metadata.

Features

  • Additional and overriding values can be provided statically or via Python string templates.
  • Order of the resulting fields can be defined, has a non-arbitrary default.
  • Dynamic fields are resolved for the setuptools build backend.

Example

Given a pyproject.toml that includes these contents:

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "cff-from-621"
description = "Generates metadata in the Citation File Format for Python projects from their PEP-621 compliant package definition. Includes a CLI."
keywords = ["PEP-621", "CFF", "conversion"]
authors = [
    {name = "Frank Sachsenheim"}
]
dynamic = ["version"]

[tool.cff-from-621]
order = ["message", "cff-version", "title", "abstract", "version", "date-released", "authors", "keywords"]

[tool.cff-from-621.static]
date-released = "2022-09-18"
message = "🔥🌍🔥"

[tool.setuptools.dynamic]
version = {attr = "cff_from_621.version.VERSION"}

cff-from-621 would derive this CITATION.cff:

---
message: 🔥🌍🔥
cff-version: 1.2.0
title: cff-from-621
abstract: Generates metadata in the Citation File Format for Python projects from
  their PEP-621 compliant package definition. Includes a CLI.
version: 0.0.1
date-released: '2022-09-18'
authors:
- name: Frank Sachsenheim
keywords:
- PEP-621
- CFF
- conversion
type: software
...

Installation

Add cff-from-621 with your environment management or install it globally with pipx:

$ pipx install cff-from-621

Usage

Change into your project's root folder and jump right in with:

$ cff-from-621

The usage details can be explored with:

$ cff-from-621 --help

Caveats

  1. Authors / maintainers are represented as entity type because their PEP-621 representation can't be parsed into the atomicity of the person type.

Development

This tool isn't supposed to cover each and every corner case that may exist. Its implementation shall be kept simple and may be used as library for custom extensions and alterations. All contributions within that frame are welcome.

In a virtual environment that you set up for development, install this package from source in editable mode and required development tools:

$ pip install .[development]

Make use of or refer to the accompanying justfile to run common development tasks.

Metadata

Release files for cff-from-621 0.1

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

Source distribution (sdist)

Source distribution for cff-from-621 0.1
File Size Uploaded
cff_from_621-0.1.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cff-from-621 0.1
File Interpreter ABI Platform
cff_from_621-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 kB

Release files / cff_from_621-0.1.tar.gz

Download URL cff_from_621-0.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f3de79f3ccd18ee16822e2117b2349c5269078efab2b7eb21e25e2bce3618009
BLAKE2b-256 checksum
How to use checksums
838a1ff3e53d3b3495dabf9aa1d378b90ee563cd3244bd16f128eb189b5337b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / cff_from_621-0.1-py3-none-any.whl

Download URL cff_from_621-0.1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
902ead16342ac6dffe615e2682c9c163295f09a0f1a6c9963c4635b29ede5a36
BLAKE2b-256 checksum
How to use checksums
43df5b511f2b7efe579d6313cb33135a88d1fd494a9740b0206d5945e3792df5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

0.0.1

2 release files

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