Skip to main content

Easily create citations from URLs

Project description

easycit - Create Citations from the command-line

PyPI Changelog Tests License

Easily create citations from website URLs.

Installation

Install this tool using pip:

pip install easycit

Usage

For help, run:

easycit --help

You can also use:

python -m easycit --help

Generate a Citation

To generate a citation, use the following command:

easycit create <URL> -f <format>

Available Options

  • -f, --fmt [mla|apa|chicago|IEEE|Harvard]: The citation format (default: mla).
  • --no-date: Omit the accessed date from the citation.
  • --no-url: Omit the URL from the citation.
  • --override : Override specific fields (e.g., --override author "John Doe").
  • --dump: Don't dump citation to stdout (default: True).
  • --log: Prevent citation from being logged into the database (default: True).

Batch Processing

To generate citations for multiple URLs from a file, use the following command:

easycit batch <file> -f <format>

Available Options

  • -f, --fmt [mla|apa|chicago|IEEE|Harvard]: The citation format (default: mla).
  • --no-date: Omit the accessed date from the citation.
  • --no-url: Omit the URL from the citation.
  • --override : Override specific fields (e.g., --override author "John Doe").
  • --dump: Don't dump citation to stdout (default: True).
  • --log: Prevent citation from being logged into the database (default: True).

List Logs

To list the logged citations, use the following command:

easycit logs list

Available Options

  • -n, --count : Number of entries to show - defaults to 3, use 0 for all.
  • -q, --query : Search for logs matching this string.

Examples

Generate an MLA citation:

easycit create https://realpython.com/python-serialize-data/ -f mla

Generate an APA citation without the accessed date:

easycit create https://realpython.com/python-serialize-data/ -f apa --no-date

Generate a Chicago citation without the URL:

easycit create https://realpython.com/python-serialize-data/ -f chicago --no-url

Override the author and title fields:

easycit create https://realpython.com/python-serialize-data/ -f apa --override author "John Doe" --override title "Custom Title"

Generate citations for multiple URLs from a file:

easycit batch urls.txt -f mla

List all logged citations:

easycit logs list --count 3

Search for logged citations containing a specific string:

easycit logs list --query "Python"

Browsing logs using Datasette

You can also use Datesette to browse your logs like this:

datasette "$(easycit logs path)"

Development

To contribute to this tool, first checkout the code. Then create a new virtual environment:

cd easycit
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

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

easycit-0.2.0.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

easycit-0.2.0-py3-none-any.whl (10.1 kB view hashes)

Uploaded Python 3

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