Skip to main content

Carbon Property Tables Python SDK

The SDK requests citation-backed comparison figures rendered by the Carbon Property Tables service. It is a figure and benchmarking interface, not a bulk database-download client or a local copy of the canonical dataset.

Install

python -m pip install carbon-property-tables==0.3.5

Make a figure

import carbon_property_tables as cpt

figure = cpt.scatter(
    "specific strength",
    "specific conductivity",
    log_x=True,
    log_y=True,
)

figure.save_bundle("conductivity-strength")
figure

save_bundle() writes editable SVG, publication-resolution PNG, Nature-style citation text, BibTeX, and a value-free reproducibility manifest tied to the exact database release. SVG and PNG are requested together by default. Request PDF explicitly with formats=("svg", "png", "pdf") when needed.

The first property is the x-axis and the second is the y-axis. Readable names are accepted, including "specific cond", "tenacity", "tensile strength", and "thermal conductivity". Misspelled or unknown properties fail explicitly instead of being guessed.

The other figure modes use the same interface:

ranked = cpt.ranked("density", "tensile strength", top=10)
trend = cpt.trend("density", "tensile strength")
ashby = cpt.ashby("density", "specific strength")

Run the complete acceptance test

cpt-feature-tour --output-dir cpt-feature-tour-output

The command tests the production release, property and publication-search endpoints, scatter/ranked/trend/Ashby figures, material filters, a temporary ranked point, the bounded top table, SVG/PNG/PDF exports, citation and BibTeX sidecars, and validation boundaries. It writes inspectable artifacts plus feature-tour-report.json to the selected directory and exits nonzero on any failure.

The equivalent module command is:

python -m carbon_property_tables.feature_tour --output-dir cpt-feature-tour-output

Install locally

python -m pip install -e ./python

The default client uses the live service at https://carbonnanotubes.onrender.com/api/v1. Set CPT_API_URL or pass a URL to CPTClient to target a local or alternate deployment.

Benchmark a temporary result

import carbon_property_tables as cpt
from carbon_property_tables import TemporaryPoint

comparison = cpt.scatter(
    "specific_strength",
    "specific_electrical_conductivity",
    log_x=True,
    log_y=True,
    peer_reviewed=True,
    material_family=["CNT_or_CNT_hybrid", "CNT_metal_composite"],
    top=5,
    top_by="y",
    formats=("svg", "png", "pdf"),
    temporary=TemporaryPoint(
        x=1.8,
        y=12.0,
        label="My CNT fiber",
    ),
)

comparison.save("conductivity-strength.svg")
print(comparison.temporary_point)

Temporary coordinates use the display units printed on the active axes. They are rendered and ranked against the visible representative material set, but are never written to Carbon Property Tables.

In Jupyter, returning figure from a cell displays its SVG directly. save() writes one requested format with matching citation sidecars. save_bundle() writes all requested formats once, plus .citations.txt, .bib, and .manifest.json sidecars.

Check DOI coverage without extracting values

import carbon_property_tables as cpt

if cpt.has_doi("10.1126/science.adj1082"):
    print("Represented in Carbon Property Tables")

status = cpt.doi_status("https://doi.org/10.1126/science.adj1082")
print(status.title, status.journal, status.year)

The DOI lookup is exact and rate-limited. It returns only presence and bibliographic identity; it does not return record IDs, available properties, measurements, coordinates, or sample counts.

Search represented publications

import carbon_property_tables as cpt

matches = cpt.search("Xinshi Zhang dynamic strength", limit=10)
for publication in matches:
    print(publication.title, publication.doi, publication.match_fields)

exact = cpt.search("10.1126/science.adj1082")
print(exact[0].journal, exact[0].year)

Search covers DOI, title, authors, journal, publication year, and indexed material/process keywords. Results are deterministically ranked and collapsed to one entry per publication. They contain bibliographic metadata only, with no record IDs, sample labels, available-property lists, values, measurements, or coordinates. Crossref and OpenAlex are used during curation and validation, not as live search fallbacks, so every returned result is actually represented in the active CPT release.

Extract a bounded top table

Exact values can be requested only for the selected top subset, with a hard maximum of ten rows:

for row in comparison.top_table():
    print(row["rank"], row["label"], row["y_value"], row["y_unit"], row["doi"])

comparison.save_top_table("top-five.csv")

top_by="x" or top_by="y" must name a higher-is-better performance axis. Density and dimensions are filter or normalization variables, not optimization targets.

Figure modes

  • scatter compares any two same-record properties.
  • ranked ranks the y property among records that also contain the selected x property.
  • trend plots the selected y property against publication year.
  • ashby enforces logarithmic axes and shows robust material-family regions where enough data exist.

All bounded figure filters supported by the service can be passed as keyword arguments. For example:

figure = cpt.scatter(
    "density",
    "tensile_strength",
    measurement_filter=["diameter::0.000020"],
    gauge_length_min_mm=10,
    year_min=2015,
)

Measurement-range filters use canonical SI units. Axis values and temporary-point inputs use the display units printed on the figure.

Deliberate access boundary

The public SDK does not expose canonical-record pagination, arbitrary record retrieval, full plot-coordinate tables, or a local plotting engine. Exact tabular output is limited to the explicitly requested top subset and capped at ten rows. A rendered vector figure can still be digitized, so this is an access and citation boundary rather than digital-rights management. Publication use requires the automatically supplied original-source and Carbon Property Tables citations.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carbon_property_tables-0.3.5.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

carbon_property_tables-0.3.5-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file carbon_property_tables-0.3.5.tar.gz.

File metadata

  • Download URL: carbon_property_tables-0.3.5.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for carbon_property_tables-0.3.5.tar.gz
Algorithm Hash digest
SHA256 e94d25e6db08f945a3d058714d42def23a4976fe112615d7ffc045a19cabdf7a
MD5 220a25d587b09a5e952c481f1e05270f
BLAKE2b-256 ee54db4c8a5e5d7b5d2800360a4e623908af0826538a1e2102235ffdd3ff2b7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for carbon_property_tables-0.3.5.tar.gz:

Publisher: python-sdk.yml on gs-stanford/CarbonNanotubes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file carbon_property_tables-0.3.5-py3-none-any.whl.

File metadata

File hashes

Hashes for carbon_property_tables-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3c690edf2a216337e4585db7657a86515ec87f4b5e808c9eee2cc58d71a4feb9
MD5 85a4a7482262e417d9eaaa423adb958f
BLAKE2b-256 aaa5ef536050241665a552b75b9b1a964e7377ac6d84c71014cd3c02c685ed7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for carbon_property_tables-0.3.5-py3-none-any.whl:

Publisher: python-sdk.yml on gs-stanford/CarbonNanotubes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.5 This release

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page