Skip to main content

No project description provided

Project description

Bibliograpy

Bibliography management to decorate source code.

example workflow

Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge

PyPI repository Badge

API

The Bibliograpy API allows to manage bibliographic centralized references using decorators.

Hence, is it possible to factorize all bibliographic sources as variables in a single module, using them as arguments of decorators.

"""The bibliography module."""

from bibliograpy.api import TechReport

IAU_2006_B1 = TechReport.generic(
    cite_key='iau_2006_b1',
    author='',
    institution='iau',
    title='Adoption of the P03 Precession Theory and Definition of the Ecliptic',
    year=2006)
"""The bibliography_client module using the bibliography.py module."""

from bibliograpy.api import reference

from bibliography import IAU_2006_B1

@reference(IAU_2006_B1)
def my_function():
    """My my_function documentation."""
    # some implementation here using the reference given as a parameter to the decorator

The usage of the decorator has two purposes.

First, to use a bibliographic reference defined once and for all, centralized and reusable.

Second, to implicitly add to the documentation of the decorated entity a bibliographical section.

import bibliography_client

>>> help(my_function)
Help on function my_function in module bibliography_client

my_function()
    My my_function documentation.

    Bibliography: Adoption of the P03 Precession Theory and Definition of the Ecliptic [iau_2006_b1]

Preprocessing tool

Bibliograpy allows generating a source code bibliograpy from a resource bibliography file.

Bibliograpy process supports bibliography files in yaml format. Each bibliographic entry contains three fields. The type field only supports the misc value. The key fields represents the bibliographic entry unique key (id). The title field represents the readable form or the entry. For instance:

- entry_type: misc
  cite_key: nasa
  title: NASA
- entry_type: misc
  cite_key: iau
  title: International Astronomical Union

This bibliography file can be preprocessend by the bibliograpy process tool.

bibliograpy process

This preprocessing produces the corresponding bibliographic references that can be used as bibliograpy decorator arguments.

from bibliograpy.api import Misc

NASA = Misc.generic(cite_key='nasa',
                    title='NASA')

IAU = Misc.generic(cite_key='iau',
                   title='International Astronomical Union')

Cross-referencing support

Example, from a bibtex bibliography:

@misc{ogc,
 institution = {OGC},
 title = {Open Geospatial Consortium}
}

@misc{iogp,
 institution = {IOGP},
 title = {International Association of Oil & Gas Producers}
}

@misc{zeitschrift_fur_vermessungswesen,
 journal = {Zeitschrift für Vermessungswesen},
 title = {Zeitschrift für Vermessungswesen}
}

@techreport{tga,
 author = {},
 institution = {},
 month = {september},
 title = {TGA File Format},
 type = {document},
 year = {1989}
}

@book{real_time_collision_detection,
 editor = {Sony Computer Entertainment America, CRC Press},
 publisher = {},
 title = {Real-Time Collision Detection},
 year = {2004}
}

@book{map_projections,
 editor = {UNITED STATES GOVERNMENT PRINTING OFFICE, WASHINGTON},
 publisher = {},
 title = {Map Projections - A Working Manual},
 year = {1987}
}

@techreport{sf_access_part_1_v1_2_1,
 author = {},
 crossref = {ogc},
 number = {OGC 06-103r4},
 title = {OpenGIS Implementation Standard for Geographic information - Simple Feature Access - Part 1: Common architecture},
 type = {standard},
 year = {2011}
}

@techreport{iogp_guidance_note_7_2_2019,
 author = {},
 crossref = {iogp},
 number = {373-7-2},
 title = {Geomatics Guidance Note 7, part 2 Coordinate Conversions & Transformations including Formulas},
 type = {document},
 year = {2019}
}

@techreport{cts_revision_v1_0,
 author = {},
 crossref = {ogc},
 month = {January},
 number = {OGC 01-009},
 title = {Coordinate Transformation Services},
 type = {standard},
 year = {2001}
}

@techreport{wkt_crs_v1_0,
 author = {},
 crossref = {ogc},
 month = {May},
 number = {OGC 12-063r5},
 title = {Geographic information - Well known text representation of coordinate reference systems},
 type = {standard},
 year = {2015}
}

@techreport{wkt_crs_v2_1,
 author = {},
 crossref = {ogc},
 month = {August},
 number = {OGC 18-010r11},
 title = {Geographic information - Well known text representation of coordinate reference systems},
 type = {standard},
 year = {2023}
}

@article{joachim_boljen_2003,
 author = {},
 crossref = {zeitschrift_fur_vermessungswesen},
 pages = {244-250},
 title = {Bezugssystemumstellung DHDN90 ETRS89 in Schleswig-Holstein},
 volume = {128},
 year = {2003}
}

@article{joachim_boljen_2004,
 author = {},
 crossref = {zeitschrift_fur_vermessungswesen},
 pages = {258-260},
 title = {Zur geometrischen Interpretation und direkten Bestimmung von Formfunktionen},
 volume = {129},
 year = {2004}
}

or json formatted:

[
    {
        "entry_type": "misc",
        "cite_key": "ogc",
        "title": "Open Geospatial Consortium",
        "institution": "OGC"
    },
    {
        "entry_type": "misc",
        "cite_key": "iogp",
        "title": "International Association of Oil & Gas Producers",
        "institution": "IOGP"
    },
    {
        "entry_type": "misc",
        "cite_key": "zeitschrift_fur_vermessungswesen",
        "title": "Zeitschrift für Vermessungswesen",
        "journal": "Zeitschrift für Vermessungswesen",
        "issn": "0044-3689"
    },
    {
        "entry_type": "techreport",
        "cite_key": "tga",
        "author": "",
        "institution": "",
        "year": 1989,
        "month": "september",
        "type": "document",
        "title": "TGA File Format",
        "url": "http://tfc.duke.free.fr/coding/tga_specs.pdf"
    },
    {
        "entry_type": "book",
        "cite_key": "real_time_collision_detection",
        "title": "Real-Time Collision Detection",
        "publisher": "",
        "editor": "Sony Computer Entertainment America, CRC Press",
        "year": 2004
    },
    {
        "entry_type": "book",
        "cite_key": "map_projections",
        "title": "Map Projections - A Working Manual",
        "editor": "UNITED STATES GOVERNMENT PRINTING OFFICE, WASHINGTON",
        "publisher": "",
        "url": "https://pubs.usgs.gov/pp/1395/report.pdf",
        "year": 1987
    },
    {
        "entry_type": "techreport",
        "cite_key": "sf_access_part_1_v1_2_1",
        "author": "",
        "type": "standard",
        "title": "OpenGIS Implementation Standard for Geographic information - Simple Feature Access - Part 1: Common architecture",
        "year": 2011,
        "number": "OGC 06-103r4",
        "version": "1.2.1",
        "crossref": "ogc",
        "url": "http://portal.opengeospatial.org/files/?artifact_id=25355"
    },
    {
        "entry_type": "techreport",
        "cite_key": "iogp_guidance_note_7_2_2019",
        "author": "",
        "type": "document",
        "title": "Geomatics Guidance Note 7, part 2 Coordinate Conversions & Transformations including Formulas",
        "crossref": "iogp",
        "year": 2019,
        "url": "https://www.iogp.org/wp-content/uploads/2019/09/373-07-02.pdf",
        "number": "373-7-2"
    },
    {
        "entry_type": "techreport",
        "cite_key": "cts_revision_v1_0",
        "author": "",
        "type": "standard",
        "title": "Coordinate Transformation Services",
        "year": 2001,
        "month": "January",
        "day": 12,
        "number": "OGC 01-009",
        "version": "1.00",
        "crossref": "ogc",
        "url": "https://portal.ogc.org/files/?artifact_id=999"
    },
    {
        "entry_type": "techreport",
        "cite_key": "wkt_crs_v1_0",
        "author": "",
        "type": "standard",
        "title": "Geographic information - Well known text representation of coordinate reference systems",
        "year": 2015,
        "month": "May",
        "day": 1,
        "number": "OGC 12-063r5",
        "version": "1.0",
        "crossref": "ogc",
        "url": "http://docs.opengeospatial.org/is/12-063r5/12-063r5.html"
    },
    {
        "entry_type": "techreport",
        "cite_key": "wkt_crs_v2_1",
        "author": "",
        "type": "standard",
        "title": "Geographic information - Well known text representation of coordinate reference systems",
        "year": 2023,
        "month": "August",
        "day": 16,
        "number": "OGC 18-010r11",
        "version": "2.1.11",
        "crossref": "ogc",
        "url": "https://docs.ogc.org/is/18-010r11/18-010r11.pdf"
    },
    {
        "entry_type": "article",
        "cite_key": "joachim_boljen_2003",
        "author": "",
        "title": "Bezugssystemumstellung DHDN90 ETRS89 in Schleswig-Holstein",
        "crossref": "zeitschrift_fur_vermessungswesen",
        "year": 2003,
        "volume": "128",
        "pages": "244-250",
        "url": "https://geodaesie.info/system/files/privat/zfv_2003_4_Boljen.pdf"
    },
    {
        "entry_type": "article",
        "cite_key": "joachim_boljen_2004",
        "author": "",
        "title": "Zur geometrischen Interpretation und direkten Bestimmung von Formfunktionen",
        "crossref": "zeitschrift_fur_vermessungswesen",
        "year": 2004,
        "volume": "129",
        "pages": "258-260",
        "url": "https://geodaesie.info/system/files/privat/zfv_2004_4_Boljen.pdf"
    }
]

Whe preprocessed, the bibliography produces some python constants to import in the code which uses these bibliographical references.

from bibliograpy.api import *


OGC = Misc.generic(cite_key='ogc',
                   institution='OGC',
                   title='Open Geospatial Consortium')

IOGP = Misc.generic(cite_key='iogp',
                    institution='IOGP',
                    title='International Association of Oil & Gas Producers')

ZEITSCHRIFT_FUR_VERMESSUNGSWESEN = Misc.generic(cite_key='zeitschrift_fur_vermessungswesen',
                                                journal='Zeitschrift für Vermessungswesen',
                                                title='Zeitschrift für Vermessungswesen',
                                                non_standard=NonStandard(issn='0044-3689'))

TGA = TechReport.generic(cite_key='tga',
                         author='',
                         institution='',
                         month='september',
                         title='TGA File Format',
                         type='document',
                         year=1989,
                         non_standard=NonStandard(url='http://tfc.duke.free.fr/coding/tga_specs.pdf'))

REAL_TIME_COLLISION_DETECTION = Book.generic(cite_key='real_time_collision_detection',
                                             editor='Sony Computer Entertainment America, CRC Press',
                                             publisher='',
                                             title='Real-Time Collision Detection',
                                             year=2004)

MAP_PROJECTIONS = Book.generic(cite_key='map_projections',
                               editor='UNITED STATES GOVERNMENT PRINTING OFFICE, WASHINGTON',
                               publisher='',
                               title='Map Projections - A Working Manual',
                               year=1987,
                               non_standard=NonStandard(url='https://pubs.usgs.gov/pp/1395/report.pdf'))

SF_ACCESS_PART_1_V1_2_1 = TechReport.generic(cite_key='sf_access_part_1_v1_2_1',
                                             author='',
                                             crossref=OGC,
                                             number='OGC 06-103r4',
                                             title='OpenGIS Implementation Standard for Geographic information - Simple Feature Access - Part 1: Common architecture',
                                             type='standard',
                                             year=2011,
                                             non_standard=NonStandard(url='http://portal.opengeospatial.org/files/?artifact_id=25355'))

IOGP_GUIDANCE_NOTE_7_2_2019 = TechReport.generic(cite_key='iogp_guidance_note_7_2_2019',
                                                 author='',
                                                 crossref=IOGP,
                                                 number='373-7-2',
                                                 title='Geomatics Guidance Note 7, part 2 Coordinate Conversions & Transformations including Formulas',
                                                 type='document',
                                                 year=2019,
                                                 non_standard=NonStandard(url='https://www.iogp.org/wp-content/uploads/2019/09/373-07-02.pdf'))

CTS_REVISION_V1_0 = TechReport.generic(cite_key='cts_revision_v1_0',
                                       author='',
                                       crossref=OGC,
                                       month='January',
                                       number='OGC 01-009',
                                       title='Coordinate Transformation Services',
                                       type='standard',
                                       year=2001,
                                       non_standard=NonStandard(url='https://portal.ogc.org/files/?artifact_id=999'))

WKT_CRS_V1_0 = TechReport.generic(cite_key='wkt_crs_v1_0',
                                  author='',
                                  crossref=OGC,
                                  month='May',
                                  number='OGC 12-063r5',
                                  title='Geographic information - Well known text representation of coordinate reference systems',
                                  type='standard',
                                  year=2015,
                                  non_standard=NonStandard(url='http://docs.opengeospatial.org/is/12-063r5/12-063r5.html'))

WKT_CRS_V2_1 = TechReport.generic(cite_key='wkt_crs_v2_1',
                                  author='',
                                  crossref=OGC,
                                  month='August',
                                  number='OGC 18-010r11',
                                  title='Geographic information - Well known text representation of coordinate reference systems',
                                  type='standard',
                                  year=2023,
                                  non_standard=NonStandard(url='https://docs.ogc.org/is/18-010r11/18-010r11.pdf'))

JOACHIM_BOLJEN_2003 = Article.generic(cite_key='joachim_boljen_2003',
                                      author='',
                                      crossref=ZEITSCHRIFT_FUR_VERMESSUNGSWESEN,
                                      pages='244-250',
                                      title='Bezugssystemumstellung DHDN90 ETRS89 in Schleswig-Holstein',
                                      volume='128',
                                      year=2003,
                                      non_standard=NonStandard(url='https://geodaesie.info/system/files/privat/zfv_2003_4_Boljen.pdf'))

JOACHIM_BOLJEN_2004 = Article.generic(cite_key='joachim_boljen_2004',
                                      author='',
                                      crossref=ZEITSCHRIFT_FUR_VERMESSUNGSWESEN,
                                      pages='258-260',
                                      title='Zur geometrischen Interpretation und direkten Bestimmung von Formfunktionen',
                                      volume='129',
                                      year=2004,
                                      non_standard=NonStandard(url='https://geodaesie.info/system/files/privat/zfv_2004_4_Boljen.pdf'))

Documentation

Latest release

Trunk

Project details


Download files

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

Source Distribution

bibliograpy-0.1.0.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

bibliograpy-0.1.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file bibliograpy-0.1.0.tar.gz.

File metadata

  • Download URL: bibliograpy-0.1.0.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for bibliograpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 45fae0b5659648e5ba889be2f0360c9b65fedaa54d6d6a9436dd126b02959fed
MD5 7b010198fc95f527500c507de288d100
BLAKE2b-256 c8f8327e18443ba4d5781968ad6ffc3380929c6831aeeaa1361323dab4bd0d4c

See more details on using hashes here.

File details

Details for the file bibliograpy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bibliograpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for bibliograpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 357a8e506de8a91f821b1fa3e42c5bfc0a3989e0ac4a5b038181102e9c90ab4b
MD5 c8fb386000d32055435084b0fb554319
BLAKE2b-256 20dcfa73773ddf677627798a1790c1791d973a18afba5fbdfeb564d81483c82c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page