Skip to main content

tool for managing structured data about legal authority

Project description

AuthoritySpoke

CircleCI Coverage Status

AuthoritySpoke is the first open source legal authority automation tool.

Installing AuthoritySpoke

AuthoritySpoke is a Python package available on PyPI, so you can install it with pip:

$ pip install authorityspoke

AuthoritySpoke is tested on Python 3.7 and is not yet working on Python 3.8.

Trying it Out

Here's an example that discovers contradictory legal holdings in Oracle America, Inc. v. Google Inc., 750 F.3d 1339 (a famous case that dealt with a claim that the Android operating system infringed the copyright on the Java language) and Lotus Development Corporation v. Borland International, 49 F.3d 807 (an older case about whether a user interface was copyrightable).

Copies of both opinions can be loaded from the example_data folder. (But you can also use AuthoritySpoke to retrieve opinions from the Caselaw Access Project API.)

from authorityspoke.io.loaders import load_and_read_decision

oracle = load_and_read_decision("oracle_h.json")
lotus = load_and_read_decision("lotus_h.json")

The example_data folder also contains legislation in XML files that can be organized by linking them to a Regime object.

from authorityspoke import Regime

from authorityspoke.io.loaders import load_and_read_code

usa = Regime()

usa.set_code(load_and_read_code("constitution.xml"))
usa.set_code(load_and_read_code("usc17.xml"))
usa.set_code(load_and_read_code("cfr37.xml"))

Structured annotations about the holdings in Oracle and Lotus can also be loaded from the example_data folder, and can be linked to the Decision objects.

from authorityspoke.io.loaders import load_and_read_holdings

oracle.posit(load_and_read_holdings("holding_oracle.json", regime=usa))
lotus.posit(load_and_read_holdings("holding_lotus.json", regime=usa))

Now, each Decision has a .contradicts method that can return a boolean indicating whether its holdings conflict with the holdings of another Decision.

print(lotus.contradicts(oracle))
True

That's good to know, but we don't want to take it on faith that a contradiction exists. Let's use the explain_contradiction method to find the contradictory Holdings posited by the Oracle and Lotus cases, and to generate a rudimentary explanation of why they contradict.

explanation = lotus.explain_contradiction(oracle)
print(explanation)
an Explanation of why there is a CONTRADICTION between
  the Holding to ACCEPT
    the Rule that the court MUST ALWAYS impose the
      RESULT:
        the Fact it is false that <the Lotus menu command hierarchy> was
        copyrightable
      GIVEN:
        the Fact that <the Lotus menu command hierarchy> was a method of
        operation
      DESPITE:
        the Fact that a text described <the Lotus menu command hierarchy>
        the Fact that <the Lotus menu command hierarchy> was an original work
      GIVEN the ENACTMENTS:
        "In no case does copyright protection for an original work of
        authorship extend to any" (Title 17, /us/usc/t17/s102/b)
        "method of operation" (Title 17, /us/usc/t17/s102/b)
and
  the Holding to ACCEPT
    the Rule that the court MUST SOMETIMES impose the
      RESULT:
        the Fact that <the Java API> was copyrightable
      GIVEN:
        the Fact that <the Java language> was a computer program
        the Fact that <the Java API> was a set of application programming
        interface declarations
        the Fact that <the Java API> was an original work
        the Fact that <the Java API> was a non-literal element of <the Java
        language>
        the Fact that <the Java API> was the expression of an idea
        the Fact it is false that <the Java API> was essentially the only way
        to express the idea that it embodied
        the Fact that <the Java API> was creative
        the Fact that it was possible to use <the Java language> without
        copying <the Java API>
      DESPITE:
        the Fact that <the Java API> was a method of operation
        the Fact that <the Java API> contained short phrases
        the Fact that <the Java API> became so popular that it was the
        industry standard
        the Fact that there was a preexisting community of programmers
        accustomed to using <the Java API>
      GIVEN the ENACTMENT:
        "Copyright protection subsists, in accordance with this title, in
        original works of authorship fixed in any tangible medium of
        expression, now known or later developed, from which they can be
        perceived, reproduced, or otherwise communicated, either directly or
        with the aid of a machine or device." (Title 17, /us/usc/t17/s102/a)
      DESPITE the ENACTMENTS:
        "In no case does copyright protection for an original work of
        authorship extend to any" (Title 17, /us/usc/t17/s102/b)
        "method of operation" (Title 17, /us/usc/t17/s102/b)
        "The following are examples of works not subject to copyright and
        applications for registration of such works cannot be entertained: (a)
        Words and short phrases such as names, titles, and slogans;" (Code of
        Federal Regulations Title 37, /us/cfr/t37/s202.1)
is that <the Lotus menu command hierarchy> is like <the Java API>

Learning about AuthoritySpoke

You can find the example above and much more information about using AuthoritySpoke in the Introduction to AuthoritySpoke Jupyter notebook.

Use the button below to interact with the notebook online through Binder. If you use Binder, you'll be shown the directory structure of this repo. Navigate to the notebooks folder to find the tutorials.

Binder

You can also find static versions of the tutorial notebooks, the API documentation, and more in the project documentation.

Contributing to AuthoritySpoke

All participants are expected to follow the code of conduct. AuthoritySpoke uses the Contributor Covenant, version 1.4.

Submitting a pull request or other code contribution to AuthoritySpoke requires acceptance of a contributor license agreement. The agreement's provisions are based on the Apache Software Foundation Individual Contributor License Agreement V2.0.

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

AuthoritySpoke-0.3.2.tar.gz (106.6 kB view details)

Uploaded Source

Built Distribution

AuthoritySpoke-0.3.2-py3-none-any.whl (90.9 kB view details)

Uploaded Python 3

File details

Details for the file AuthoritySpoke-0.3.2.tar.gz.

File metadata

  • Download URL: AuthoritySpoke-0.3.2.tar.gz
  • Upload date:
  • Size: 106.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5

File hashes

Hashes for AuthoritySpoke-0.3.2.tar.gz
Algorithm Hash digest
SHA256 a0a77fe1d0ed0e96235cf3e8f89f2cdd4dcfdd46c03a923153277a843042f6ee
MD5 d8aa1203a818b38635be5384607f446e
BLAKE2b-256 1af180cda71ae368156c130ebce74c8af99a02e1e9d779b6ddc7c47d8d8e16b4

See more details on using hashes here.

File details

Details for the file AuthoritySpoke-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: AuthoritySpoke-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 90.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5

File hashes

Hashes for AuthoritySpoke-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2736876c40931193af74fbe495281218f3830d9a45ef6a952922991debaa73f7
MD5 49d5d8f7d9c53f0b1f8b4d2bfa42b3c6
BLAKE2b-256 60ceb66cd394a75d51a60fc13ac9425341821ac298bb421cb7b27f27f2ab8ea0

See more details on using hashes here.

Supported by

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