etspi


Nameetspi JSON
Version 1.0.4 PyPI version JSON
download
home_pagehttps://github.com/sov2000/etspi-cli
SummaryCLI App to manage Etsy shop and listings.
upload_time2025-01-10 16:24:39
maintainerNone
docs_urlNone
authorsov2000
requires_python<4.0,>=3.12
licenseMIT
keywords etsy api shop manager
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Etsy Shop CLI

Etspi is a command-line tool that empowers Etsy sellers to manage their shops and listings efficiently. The tool is an interface to the [API](https://developers.etsy.com/documentation) 
provided by Etsy and allows viewing and managing the shop and the listings directly with JSON.

## Prerequisites:

- Access to the Etsy API is essential. Review [Etsy Quick Start Guide](https://developers.etsy.com/documentation/tutorials/quickstart) for directions on how to get your personal API key. 
- Familiarize yourself with the Etsy OAuth 2.0 authentication process ([link to Etsy OAuth 2.0 documentation](https://developers.etsy.com/documentation/essentials/authentication))
- Familiarity with JMESPath expressions ([link to JMESPath examples](https://jmespath.org/examples.html)) is recommended to filter and transform output data.

## Features:
- **Easy Authentication and Authorization:** Etspi guides you through the process of obtaining and managing API tokens.
- **Automatic Token Management:** Etspi simplifies token maintenance by automatically refreshing access tokens as needed (if configured).
- **Listing Management:** Handle shop listings and variant inventory directly from the command line.
- **Flexible Output Filtering:** Tailor output using JMESPath expressions to retrieve only the data you need.
- **Streamlined Request Formatting:** Transform listing data effortlessly into the appropriate format for draft, listing, or inventory operations.

## Installation:

The recommended installation method is via `pipx`. Refer to the official `pipx` documentation ([link to pipx doc site](https://pipx.pypa.io/stable/)) for installation and usage instructions.

```bash
pipx install etspi
```
If you plan to use Etspi to obtain API tokens, you will also need to have `openssl` installed or some other means to generate certificates suitable for SSL/TLS to secure HTTP server. Alternatively, you can use dedicated tools like Postman to obtain tokens manually. However, Etspi offers a more convenient approach, and you only need to do this once if you persist the tokens. Etspi will automatically use persited refresh token to get a fresh API token when necessary.

## Configuration:

Etspi requires `--key`, `--token`, `--refresh-token`, and `--expiry` arguments for all commands excepts the `auth` command which is used to obtain and setup these values. The values for these arguments can be also supplied via environmental variables prefixed by `ETSPI_` followed by argument name, e.g. `ETSPI_TOKEN`, `ETSPI_REFRESH_TOKEN`, etc.

Etspi will also attempt to load these values from `auth.env` file located in `.etspi` folder in user home directory. Etspi will create this folder on first invocation, but the `auth.env` file has to be created by the `auth` command with persist `-tF` flag or manually. The format for the file is standard `.env` file with `key=value` pair on each line. Because the file contains sensitive information, consider securing the file with proper permissions and ensure that it can only be read/written by the user running `etspi`.

The source and the values of the required arguments can be checked by supplying the `-v` flag to `etspi`. This will output `Auth Parameters` table with key, values, and their sources. The possible value sources are COMMANDLINE for command line arguments, ENVIRONMENT for environment variables, and DEFAULT_MAP for `auth.env` file. The precedence is such that environment variable values override the `auth.env` file values and command line arguments override both the variables and the file values.

## Authentication:

Before you can use the app, you will need to obtain an API key from Etsy. You can find more info and how to request a key on the [developer portal](https://www.etsy.com/developers). Etspi assists with authorization and tokens once you've created an app and acquired an API key. If the tokens are saved, they are automatically refreshed as needed upon expiration.

- Note the Keystring from the App settings. You will need it to start the auth flow.
- In the App settings, you will also need to add a callback URL for the Etspi that will be used in the auth flow.
    - By default, it's https://localhost:10443/etspi, but it can be customized using Etspi flags.
- Before you start the auth flow with Etspi, you will also need to create a self-signed SSL certificate/key pair for the tool to use.
    - This step is necessary as it is an Etsy requirement that the redirect callback URLs are SSL protected and contain HTTPS prefix.
    - You will need OpenSSL installation for this step.
    - Run the following from the command prompt/terminal to get the cert/key pair and save them to your home Etspi directory.
    - Linux/MacOS:

    ```bash
    openssl req -nodes -x509 -newkey rsa:2048 -keyout ~/.etspi/key.pem -out ~/.etspi/cert.pem -days 365
    ```
    - Windows:
    
    ```cmd
    openssl req -nodes -x509 -newkey rsa:2048 -keyout %USERPROFILE%\.etspi\key.pem -out %USERPROFILE%\.etspi\cert.pem -days 365
    ```

- To start the auth flow for all scopes, default redirect URL, and cert/key files from the prior step:
    ```bash
    etspi -K YOUR_API_KEY auth -tF
    ```
    - `-tF` flag saves tokens to the `auth.env` file. See `etspi auth --help` for more options.

- The Etspi will compose an Auth URL to start the flow.
- Authenticate with Etsy and authorize your app with the assigned keystring for access to the requested scopes.
- Upon authorization completion, Etsy redirects your browser to the defined callback URL, where Etspi is waiting to obtain the tokens.
- The redirect request contains an authorization code from Etsy that is needed to request the tokens.
- If successful in obtaining the tokens, they are saved in `auth.env` file in the `.etspi/` home folder.
- Most Etspi commands require authorization tokens that can either be pulled from the `auth.env` file, specified as arguments, or set as environment variables in your shell.
    - E.g. `ETSPI_KEY=YOU_ETSY_APP_KEYSTRING` or `ETSPI_TOKEN=YOUR_AUTH_TOKEN`.
    - See *Configuration* section for more details.

## User:

Retrieve current authenticated user ID and Shop ID.

```bash
etspi user
```

More User details can be retrieved for a specific User ID.

```bash
etspi user -u 123456789
```

## Shop:

Retrieve detailed shop info by Shop Id.

```bash
etspi shop-get -s 12345678
```

Same as before but pull info by User ID instead.

```bash
etspi shop-get -u 123456789
```

Alternatively, search by Shop Name performing typical partial name search.

```bash
etspi shop-get -n Paint
```

Since you the number of the results can be quite large, `-R` option can be used to limit and offset the results with the first number as the `offset` and the second number as the `limit` to retrieve.

```bash 
etspi shop-get -n Paint -R 9 1
```

## Shop Find Listings:

### shop-find

Find shop listings by various parameters and metadata. The listings can be filtered by state, section id, or keywords and sorted by Create/Update dates, price, or score. Due to API limitations, you cannot combine state and section id search or state and keyword searches.

Find first 3 listings for the shop.

```bash
etspi shop-find -s 12345678 -R 0 3
```

Same as above, but filter the output with JMESPath expression to only output `listing_id`.

```bash
etspi shop-find -s 12345678 -R 0 3 -q "results[*].listing_id"
```

Find first 5 `draft` listings for the shop.

```bash
etspi shop-find -s 12345678 -R 0 5 -q "results[*].listing_id" -st Draft
```

Find first 5 listings for the shop in `active` state and order by default `Create Date` in ascending order.

```bash
etspi shop-find -s 12345678 -R 0 5 -q "results[*].listing_id" -st Active -so Asc
```

Same as above, but this time find the listings by `Updated Date`.

```bash
etspi shop-find -s 12345678 -R 0 5 -q "results[*].listing_id" -st Active -so Asc -ss Updated
```

Find first 5 `active` listings for the shop ordered by `Price` and display `listing_id` and `title` for each.

```bash
etspi shop-find -s 12345678 -R 0 5 -q "results[*].{listing_id: listing_id, title: title}" -st Active -so Asc -ss Price
```

Find first 5 listings by `Section ID` with `-si` flag and order the result in descending order by `Created Date`.

```bash
etspi shop-find -s 12345678 -si 12345678 -R 0 5 -q "results[*].{listing_id: listing_id, title: title}" -so Desc -ss Created
```

Find first 5 listings by keyword using `-K` flag and order the result in descending order by `Created Date`'

```bash
etspi shop-find -s 12345678 -K "lily" -R 0 5 -q "results[*].{listing_id: listing_id, title: title}" -so Desc -ss Created
```

## Listing:

The following commands are used to create, update, and delete the listings along with basic listing information like title, description, tags, shipping profile, etc.

### listing-get

The most basic use case is to pull listing data by its Id.

```bash
etspi listing-get -i 1800000081
```
Include `-in` flag and option `value` to also include additional data; combine several `values` as needed.

```bash
etspi listing-get -i 1800000081 -in Images -in Shipping
```

Include `-q` or `--query` flag and JMESPath expression to filter and shape the output JSON. 

```bash
etspi listing-get -i 1800000081 -q "{ id: listing_id, title: title }"
```

Etsy listing JSON structure from `listing-get` command and `draft` or `listing-update` commands are not symmetrical. If you'd like to create a new draft from existing or update a listing, you will likely want to transform the JSON output into the format ready for `draft` or `listing-update` commands. Use `--format-draft` or `--format-update` flags and combine with `-o` flag to save the result into a file you can modify and later use with each command.

```bash
etspi listing-get -i 1800000081 -in Images --format-draft -o my_listing.json
```
### draft

Create a new draft listing from a JSON data source file. To publish your draft you will need to use the `listing-update` command and set the `state` field to `active`. *Expect Etsy to charge the **listing fee** when you activate the draft.*

```bash
etspi draft -s 10000001 -f my_draft_listing.json
```

### listing-update

Like the `draft` command, you update the listing with the values from a JSON source file specified on the command line.

```bash
etspi listing-update -i 1800000081 -s 10000001 -f my_listing_update.json
```

### listing-delete

This is self-explanatory and will delete a listing by Id. Use `-Y` or `--yes` flag to suppress ***confirmation prompt*** before making the API call to delete the listing!

```bash
etspi listing-delete -i 1800000081 -Y
```

### listing-get-iv

Retrieves the inventory record for a listing by Id.

```bash
etspi listing-get-iv -i 1800000081
```

Include `-q` or `--query` flag and JMESPath expression to filter and shape the output JSON. 

```bash
etspi listing-get-iv -i 1800000081 -q "products[?offerings[0].price.amount > `1000`].[product_id, sku]"
```

Use `--format-update` and `-o` flags to transform the output into format suitable for `listing-update-iv` command.

```bash
etspi listing-get-iv -i 1800000081 --format-update -o my_listing_inventory.json
```

### listing-update-iv

Use to update the listing inventory with the values from a JSON source file specified on the command line.

```bash
etspi listing-update-iv -i 1800000081 -f my_listing_update.json
```

## Images:

### image-get

Display all listing Images with IDs, URLs, and other metadata.

```bash
etspi image-get -i 1800000081
```

Or if information is only needed for one image, pull it by Image ID in addition to the listing ID.

```bash
etspi image-get -i 1800000081 -ii 6123123123
```
### image-upload

Upload a new image and add it to the listing at the specified `rank` with option `-r` and `-a` for alternate text. If you are uploading into existing `rank`, you will need `-O` option to allow overwriting of the content.

```bash
etspi image-upload -i 1800000081 -s 12345678 -f "path\to\my\Listing_Image_File.jpg" -r 5 -a "Tree print wall art"
```

### image-delete

Delete an image from listing by Image Id. Use `-Y` or `--yes` flag to suppress ***confirmation prompt*** before making the API call to delete.

```bash
etspi image-delete -i 1800000081 -ii 6123123123
```

## Videos:

### video-get

Display all listing Videos with IDs, URLs, and other metadata. Use this method if you do not have Video ID.

```bash
etspi video-get -i 1800000081
```

Or if information is only needed for one video and you have the ID, pull it by Video ID in addition to the listing ID.

```bash
etspi video-get -i 1800000081 -vi 6123123123
```

### video-upload

Upload a new video or update an existing video by Listing ID and Video ID.

```bash
etspi video-upload -i 1800000081 -s 12345678 -f "path\to\my\Listing_Video_File.mp4"
```

Or to update an existing video by Video ID. Supplying Video ID is redundant because, at the moment, Etsy only supports one listing video.

```bash
etspi video-upload -i 1800000081 -s 12345678 -f "path\to\my\Listing_Video_File.mp4" -vi 6123123123
```

### video-delete

Delete a video from listing by Video ID. Use `-Y` or `--yes` flag to suppress ***confirmation prompt*** before making the API call to delete.

```bash
etspi video-delete -i 1800000081 -s 12345678 -vi 6123123123 -Y
```

## Files:

File commands are used to manage file assets for digital listings. Etsy will convert a physical listing to digital if you associate a file with an existing physical listing. Similarly, a digital listing will convert to a physical one when you delete the last file from the listing.

### file-get

Display all listing Files with ID, name, size, type, etc. Use this method if you do not have a specific File ID.

```bash
etspi file-get -i 1800000081 -s 12345678
```

Or if information is only needed for one file and you have the ID, pull it by File ID in addition to the listing ID.

```bash
etspi file-get -i 1800000081 -s 12345678 -fi 13123123123123
```

### file-upload

Upload a new file from a local path.

```bash
etspi file-upload -i 1800000081 -s 12345678 -f "path\to\my\Listing_Digital_Content_File.pdf"
```

Use the `-r` or `--rank` argument to manipulate the file at the `rank` position in the list of multiple files.

```bash
etspi file-upload -i 1800000081 -s 12345678 -f "path\to\my\Listing_Digital_Content_File.pdf" -r 2
```

Or to associate an existing file with File ID to Listing ID. 

```bash
etspi file-upload -i 1800000081 -s 12345678 -fi 13123123123123
```

### file-delete

Delete a file from listing by File ID. Use `-Y` or `--yes` flag to suppress ***confirmation prompt*** before making the API call to delete.

```bash
etspi file-delete -i 1800000081 -s 12345678 -fi 13123123123123 -Y
```

## Properties:

### prop-get:

To retrieve all properties for a listing.

```bash
etspi prop-get -i 1800000081 -s 12345678
```

To retrieve a specific property (with ID 98765432) for a listing

```bash
etspi prop-get -i 1800000081 -s 12345678 -pi 98765432
```

To retrieve all properties for a listing and save the output to a file named "listing_properties.json"

```bash
etspi prop-get -i 1800000081 -s 12345678 -o listing_properties.json
```

To retrieve all properties for a listing, format the output for a listing property update request, and save the output to a file named "listing_property_update.json"

```bash
etspi prop-get -i 1800000081 -s 12345678 --format-update -o listing_property_update.json
```

### prop-update

To update a property for listing, you will need a JSON file in the correct update format. Use the `prop-get` command to generte a file you can modify in the correct format.


```bash
etspi prop-update -i 1800000081 -s 12345678 -pi 98765432 -f listing_property_update.json
```

## Note on STDOUT redirects

Etspi console output uses `rich` library `print` which will color code and format JSON for more esthetic and readable output. When using Etspi `--out` you get original formatted JSON which is what you want for subsequent commands and API calls. If you have a need to pipe or redirect Etspi output to a different console app or file, you may want this original JSON and not pretty formatted. In that case, consider using `--out` to STDOUT `-` with `-S` and apply your pipe or redirect this way.

```bash
etspi listing-get -i 1800000081 -in Inventory -S -o - | grep "sku"
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sov2000/etspi-cli",
    "name": "etspi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.12",
    "maintainer_email": null,
    "keywords": "etsy, api, shop, manager",
    "author": "sov2000",
    "author_email": "sv28k64@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/33/b4/981fb661c9dcd70afebf6c8f397e6c9d788c8a2cc382af06e2bad3eabf7a/etspi-1.0.4.tar.gz",
    "platform": null,
    "description": "# Etsy Shop CLI\n\nEtspi is a command-line tool that empowers Etsy sellers to manage their shops and listings efficiently. The tool is an interface to the [API](https://developers.etsy.com/documentation) \nprovided by Etsy and allows viewing and managing the shop and the listings directly with JSON.\n\n## Prerequisites:\n\n- Access to the Etsy API is essential. Review [Etsy Quick Start Guide](https://developers.etsy.com/documentation/tutorials/quickstart) for directions on how to get your personal API key. \n- Familiarize yourself with the Etsy OAuth 2.0 authentication process ([link to Etsy OAuth 2.0 documentation](https://developers.etsy.com/documentation/essentials/authentication))\n- Familiarity with JMESPath expressions ([link to JMESPath examples](https://jmespath.org/examples.html)) is recommended to filter and transform output data.\n\n## Features:\n- **Easy Authentication and Authorization:** Etspi guides you through the process of obtaining and managing API tokens.\n- **Automatic Token Management:** Etspi simplifies token maintenance by automatically refreshing access tokens as needed (if configured).\n- **Listing Management:** Handle shop listings and variant inventory directly from the command line.\n- **Flexible Output Filtering:** Tailor output using JMESPath expressions to retrieve only the data you need.\n- **Streamlined Request Formatting:** Transform listing data effortlessly into the appropriate format for draft, listing, or inventory operations.\n\n## Installation:\n\nThe recommended installation method is via `pipx`. Refer to the official `pipx` documentation ([link to pipx doc site](https://pipx.pypa.io/stable/)) for installation and usage instructions.\n\n```bash\npipx install etspi\n```\nIf you plan to use Etspi to obtain API tokens, you will also need to have `openssl` installed or some other means to generate certificates suitable for SSL/TLS to secure HTTP server. Alternatively, you can use dedicated tools like Postman to obtain tokens manually. However, Etspi offers a more convenient approach, and you only need to do this once if you persist the tokens. Etspi will automatically use persited refresh token to get a fresh API token when necessary.\n\n## Configuration:\n\nEtspi requires `--key`, `--token`, `--refresh-token`, and `--expiry` arguments for all commands excepts the `auth` command which is used to obtain and setup these values. The values for these arguments can be also supplied via environmental variables prefixed by `ETSPI_` followed by argument name, e.g. `ETSPI_TOKEN`, `ETSPI_REFRESH_TOKEN`, etc.\n\nEtspi will also attempt to load these values from `auth.env` file located in `.etspi` folder in user home directory. Etspi will create this folder on first invocation, but the `auth.env` file has to be created by the `auth` command with persist `-tF` flag or manually. The format for the file is standard `.env` file with `key=value` pair on each line. Because the file contains sensitive information, consider securing the file with proper permissions and ensure that it can only be read/written by the user running `etspi`.\n\nThe source and the values of the required arguments can be checked by supplying the `-v` flag to `etspi`. This will output `Auth Parameters` table with key, values, and their sources. The possible value sources are COMMANDLINE for command line arguments, ENVIRONMENT for environment variables, and DEFAULT_MAP for `auth.env` file. The precedence is such that environment variable values override the `auth.env` file values and command line arguments override both the variables and the file values.\n\n## Authentication:\n\nBefore you can use the app, you will need to obtain an API key from Etsy. You can find more info and how to request a key on the [developer portal](https://www.etsy.com/developers). Etspi assists with authorization and tokens once you've created an app and acquired an API key. If the tokens are saved, they are automatically refreshed as needed upon expiration.\n\n- Note the Keystring from the App settings. You will need it to start the auth flow.\n- In the App settings, you will also need to add a callback URL for the Etspi that will be used in the auth flow.\n    - By default, it's https://localhost:10443/etspi, but it can be customized using Etspi flags.\n- Before you start the auth flow with Etspi, you will also need to create a self-signed SSL certificate/key pair for the tool to use.\n    - This step is necessary as it is an Etsy requirement that the redirect callback URLs are SSL protected and contain HTTPS prefix.\n    - You will need OpenSSL installation for this step.\n    - Run the following from the command prompt/terminal to get the cert/key pair and save them to your home Etspi directory.\n    - Linux/MacOS:\n\n    ```bash\n    openssl req -nodes -x509 -newkey rsa:2048 -keyout ~/.etspi/key.pem -out ~/.etspi/cert.pem -days 365\n    ```\n    - Windows:\n    \n    ```cmd\n    openssl req -nodes -x509 -newkey rsa:2048 -keyout %USERPROFILE%\\.etspi\\key.pem -out %USERPROFILE%\\.etspi\\cert.pem -days 365\n    ```\n\n- To start the auth flow for all scopes, default redirect URL, and cert/key files from the prior step:\n    ```bash\n    etspi -K YOUR_API_KEY auth -tF\n    ```\n    - `-tF` flag saves tokens to the `auth.env` file. See `etspi auth --help` for more options.\n\n- The Etspi will compose an Auth URL to start the flow.\n- Authenticate with Etsy and authorize your app with the assigned keystring for access to the requested scopes.\n- Upon authorization completion, Etsy redirects your browser to the defined callback URL, where Etspi is waiting to obtain the tokens.\n- The redirect request contains an authorization code from Etsy that is needed to request the tokens.\n- If successful in obtaining the tokens, they are saved in `auth.env` file in the `.etspi/` home folder.\n- Most Etspi commands require authorization tokens that can either be pulled from the `auth.env` file, specified as arguments, or set as environment variables in your shell.\n    - E.g. `ETSPI_KEY=YOU_ETSY_APP_KEYSTRING` or `ETSPI_TOKEN=YOUR_AUTH_TOKEN`.\n    - See *Configuration* section for more details.\n\n## User:\n\nRetrieve current authenticated user ID and Shop ID.\n\n```bash\netspi user\n```\n\nMore User details can be retrieved for a specific User ID.\n\n```bash\netspi user -u 123456789\n```\n\n## Shop:\n\nRetrieve detailed shop info by Shop Id.\n\n```bash\netspi shop-get -s 12345678\n```\n\nSame as before but pull info by User ID instead.\n\n```bash\netspi shop-get -u 123456789\n```\n\nAlternatively, search by Shop Name performing typical partial name search.\n\n```bash\netspi shop-get -n Paint\n```\n\nSince you the number of the results can be quite large, `-R` option can be used to limit and offset the results with the first number as the `offset` and the second number as the `limit` to retrieve.\n\n```bash \netspi shop-get -n Paint -R 9 1\n```\n\n## Shop Find Listings:\n\n### shop-find\n\nFind shop listings by various parameters and metadata. The listings can be filtered by state, section id, or keywords and sorted by Create/Update dates, price, or score. Due to API limitations, you cannot combine state and section id search or state and keyword searches.\n\nFind first 3 listings for the shop.\n\n```bash\netspi shop-find -s 12345678 -R 0 3\n```\n\nSame as above, but filter the output with JMESPath expression to only output `listing_id`.\n\n```bash\netspi shop-find -s 12345678 -R 0 3 -q \"results[*].listing_id\"\n```\n\nFind first 5 `draft` listings for the shop.\n\n```bash\netspi shop-find -s 12345678 -R 0 5 -q \"results[*].listing_id\" -st Draft\n```\n\nFind first 5 listings for the shop in `active` state and order by default `Create Date` in ascending order.\n\n```bash\netspi shop-find -s 12345678 -R 0 5 -q \"results[*].listing_id\" -st Active -so Asc\n```\n\nSame as above, but this time find the listings by `Updated Date`.\n\n```bash\netspi shop-find -s 12345678 -R 0 5 -q \"results[*].listing_id\" -st Active -so Asc -ss Updated\n```\n\nFind first 5 `active` listings for the shop ordered by `Price` and display `listing_id` and `title` for each.\n\n```bash\netspi shop-find -s 12345678 -R 0 5 -q \"results[*].{listing_id: listing_id, title: title}\" -st Active -so Asc -ss Price\n```\n\nFind first 5 listings by `Section ID` with `-si` flag and order the result in descending order by `Created Date`.\n\n```bash\netspi shop-find -s 12345678 -si 12345678 -R 0 5 -q \"results[*].{listing_id: listing_id, title: title}\" -so Desc -ss Created\n```\n\nFind first 5 listings by keyword using `-K` flag and order the result in descending order by `Created Date`'\n\n```bash\netspi shop-find -s 12345678 -K \"lily\" -R 0 5 -q \"results[*].{listing_id: listing_id, title: title}\" -so Desc -ss Created\n```\n\n## Listing:\n\nThe following commands are used to create, update, and delete the listings along with basic listing information like title, description, tags, shipping profile, etc.\n\n### listing-get\n\nThe most basic use case is to pull listing data by its Id.\n\n```bash\netspi listing-get -i 1800000081\n```\nInclude `-in` flag and option `value` to also include additional data; combine several `values` as needed.\n\n```bash\netspi listing-get -i 1800000081 -in Images -in Shipping\n```\n\nInclude `-q` or `--query` flag and JMESPath expression to filter and shape the output JSON. \n\n```bash\netspi listing-get -i 1800000081 -q \"{ id: listing_id, title: title }\"\n```\n\nEtsy listing JSON structure from `listing-get` command and `draft` or `listing-update` commands are not symmetrical. If you'd like to create a new draft from existing or update a listing, you will likely want to transform the JSON output into the format ready for `draft` or `listing-update` commands. Use `--format-draft` or `--format-update` flags and combine with `-o` flag to save the result into a file you can modify and later use with each command.\n\n```bash\netspi listing-get -i 1800000081 -in Images --format-draft -o my_listing.json\n```\n### draft\n\nCreate a new draft listing from a JSON data source file. To publish your draft you will need to use the `listing-update` command and set the `state` field to `active`. *Expect Etsy to charge the **listing fee** when you activate the draft.*\n\n```bash\netspi draft -s 10000001 -f my_draft_listing.json\n```\n\n### listing-update\n\nLike the `draft` command, you update the listing with the values from a JSON source file specified on the command line.\n\n```bash\netspi listing-update -i 1800000081 -s 10000001 -f my_listing_update.json\n```\n\n### listing-delete\n\nThis is self-explanatory and will delete a listing by Id. Use `-Y` or `--yes` flag to suppress ***confirmation prompt*** before making the API call to delete the listing!\n\n```bash\netspi listing-delete -i 1800000081 -Y\n```\n\n### listing-get-iv\n\nRetrieves the inventory record for a listing by Id.\n\n```bash\netspi listing-get-iv -i 1800000081\n```\n\nInclude `-q` or `--query` flag and JMESPath expression to filter and shape the output JSON. \n\n```bash\netspi listing-get-iv -i 1800000081 -q \"products[?offerings[0].price.amount > `1000`].[product_id, sku]\"\n```\n\nUse `--format-update` and `-o` flags to transform the output into format suitable for `listing-update-iv` command.\n\n```bash\netspi listing-get-iv -i 1800000081 --format-update -o my_listing_inventory.json\n```\n\n### listing-update-iv\n\nUse to update the listing inventory with the values from a JSON source file specified on the command line.\n\n```bash\netspi listing-update-iv -i 1800000081 -f my_listing_update.json\n```\n\n## Images:\n\n### image-get\n\nDisplay all listing Images with IDs, URLs, and other metadata.\n\n```bash\netspi image-get -i 1800000081\n```\n\nOr if information is only needed for one image, pull it by Image ID in addition to the listing ID.\n\n```bash\netspi image-get -i 1800000081 -ii 6123123123\n```\n### image-upload\n\nUpload a new image and add it to the listing at the specified `rank` with option `-r` and `-a` for alternate text. If you are uploading into existing `rank`, you will need `-O` option to allow overwriting of the content.\n\n```bash\netspi image-upload -i 1800000081 -s 12345678 -f \"path\\to\\my\\Listing_Image_File.jpg\" -r 5 -a \"Tree print wall art\"\n```\n\n### image-delete\n\nDelete an image from listing by Image Id. Use `-Y` or `--yes` flag to suppress ***confirmation prompt*** before making the API call to delete.\n\n```bash\netspi image-delete -i 1800000081 -ii 6123123123\n```\n\n## Videos:\n\n### video-get\n\nDisplay all listing Videos with IDs, URLs, and other metadata. Use this method if you do not have Video ID.\n\n```bash\netspi video-get -i 1800000081\n```\n\nOr if information is only needed for one video and you have the ID, pull it by Video ID in addition to the listing ID.\n\n```bash\netspi video-get -i 1800000081 -vi 6123123123\n```\n\n### video-upload\n\nUpload a new video or update an existing video by Listing ID and Video ID.\n\n```bash\netspi video-upload -i 1800000081 -s 12345678 -f \"path\\to\\my\\Listing_Video_File.mp4\"\n```\n\nOr to update an existing video by Video ID. Supplying Video ID is redundant because, at the moment, Etsy only supports one listing video.\n\n```bash\netspi video-upload -i 1800000081 -s 12345678 -f \"path\\to\\my\\Listing_Video_File.mp4\" -vi 6123123123\n```\n\n### video-delete\n\nDelete a video from listing by Video ID. Use `-Y` or `--yes` flag to suppress ***confirmation prompt*** before making the API call to delete.\n\n```bash\netspi video-delete -i 1800000081 -s 12345678 -vi 6123123123 -Y\n```\n\n## Files:\n\nFile commands are used to manage file assets for digital listings. Etsy will convert a physical listing to digital if you associate a file with an existing physical listing. Similarly, a digital listing will convert to a physical one when you delete the last file from the listing.\n\n### file-get\n\nDisplay all listing Files with ID, name, size, type, etc. Use this method if you do not have a specific File ID.\n\n```bash\netspi file-get -i 1800000081 -s 12345678\n```\n\nOr if information is only needed for one file and you have the ID, pull it by File ID in addition to the listing ID.\n\n```bash\netspi file-get -i 1800000081 -s 12345678 -fi 13123123123123\n```\n\n### file-upload\n\nUpload a new file from a local path.\n\n```bash\netspi file-upload -i 1800000081 -s 12345678 -f \"path\\to\\my\\Listing_Digital_Content_File.pdf\"\n```\n\nUse the `-r` or `--rank` argument to manipulate the file at the `rank` position in the list of multiple files.\n\n```bash\netspi file-upload -i 1800000081 -s 12345678 -f \"path\\to\\my\\Listing_Digital_Content_File.pdf\" -r 2\n```\n\nOr to associate an existing file with File ID to Listing ID. \n\n```bash\netspi file-upload -i 1800000081 -s 12345678 -fi 13123123123123\n```\n\n### file-delete\n\nDelete a file from listing by File ID. Use `-Y` or `--yes` flag to suppress ***confirmation prompt*** before making the API call to delete.\n\n```bash\netspi file-delete -i 1800000081 -s 12345678 -fi 13123123123123 -Y\n```\n\n## Properties:\n\n### prop-get:\n\nTo retrieve all properties for a listing.\n\n```bash\netspi prop-get -i 1800000081 -s 12345678\n```\n\nTo retrieve a specific property (with ID 98765432) for a listing\n\n```bash\netspi prop-get -i 1800000081 -s 12345678 -pi 98765432\n```\n\nTo retrieve all properties for a listing and save the output to a file named \"listing_properties.json\"\n\n```bash\netspi prop-get -i 1800000081 -s 12345678 -o listing_properties.json\n```\n\nTo retrieve all properties for a listing, format the output for a listing property update request, and save the output to a file named \"listing_property_update.json\"\n\n```bash\netspi prop-get -i 1800000081 -s 12345678 --format-update -o listing_property_update.json\n```\n\n### prop-update\n\nTo update a property for listing, you will need a JSON file in the correct update format. Use the `prop-get` command to generte a file you can modify in the correct format.\n\n\n```bash\netspi prop-update -i 1800000081 -s 12345678 -pi 98765432 -f listing_property_update.json\n```\n\n## Note on STDOUT redirects\n\nEtspi console output uses `rich` library `print` which will color code and format JSON for more esthetic and readable output. When using Etspi `--out` you get original formatted JSON which is what you want for subsequent commands and API calls. If you have a need to pipe or redirect Etspi output to a different console app or file, you may want this original JSON and not pretty formatted. In that case, consider using `--out` to STDOUT `-` with `-S` and apply your pipe or redirect this way.\n\n```bash\netspi listing-get -i 1800000081 -in Inventory -S -o - | grep \"sku\"\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CLI App to manage Etsy shop and listings.",
    "version": "1.0.4",
    "project_urls": {
        "Homepage": "https://github.com/sov2000/etspi-cli",
        "Repository": "https://github.com/sov2000/etspi-cli"
    },
    "split_keywords": [
        "etsy",
        " api",
        " shop",
        " manager"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d492c6a3e6d6a22b10d6dec79af2ac5ccaf3cfa3351d1ecde7286f9ce6152fad",
                "md5": "e4de0aea46171469f663eb73fc164f2c",
                "sha256": "e83f1b5eca4e2680792ad95e0f7186e905dceddd4947d17c2849d5df0181a9d9"
            },
            "downloads": -1,
            "filename": "etspi-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e4de0aea46171469f663eb73fc164f2c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.12",
            "size": 76388,
            "upload_time": "2025-01-10T16:24:37",
            "upload_time_iso_8601": "2025-01-10T16:24:37.452727Z",
            "url": "https://files.pythonhosted.org/packages/d4/92/c6a3e6d6a22b10d6dec79af2ac5ccaf3cfa3351d1ecde7286f9ce6152fad/etspi-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "33b4981fb661c9dcd70afebf6c8f397e6c9d788c8a2cc382af06e2bad3eabf7a",
                "md5": "3f85b186af3ebc585ec5d08342745501",
                "sha256": "49b13dfb4fb66c20d092fe40b0c73af7b5396301d407fd169b60a65740ace597"
            },
            "downloads": -1,
            "filename": "etspi-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "3f85b186af3ebc585ec5d08342745501",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.12",
            "size": 56918,
            "upload_time": "2025-01-10T16:24:39",
            "upload_time_iso_8601": "2025-01-10T16:24:39.871227Z",
            "url": "https://files.pythonhosted.org/packages/33/b4/981fb661c9dcd70afebf6c8f397e6c9d788c8a2cc382af06e2bad3eabf7a/etspi-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-10 16:24:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sov2000",
    "github_project": "etspi-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "etspi"
}
        
Elapsed time: 1.33517s