publicdotcom-cli 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- publicdotcom_cli-1.0.0/.gitattributes +1 -0
- publicdotcom_cli-1.0.0/.gitignore +13 -0
- publicdotcom_cli-1.0.0/PKG-INFO +256 -0
- publicdotcom_cli-1.0.0/README.md +219 -0
- publicdotcom_cli-1.0.0/examples/order.single-leg.market-buy.json +12 -0
- publicdotcom_cli-1.0.0/pyproject.toml +77 -0
- publicdotcom_cli-1.0.0/scripts/generate_client.py +49 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/__init__.py +3 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/__main__.py +5 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/__init__.py +8 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/__init__.py +1 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/account_details/__init__.py +1 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/account_details/get_account_portfolio_v2.py +182 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/account_details/get_history.py +250 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/authorization/__init__.py +1 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/authorization/create_personal_access_token.py +230 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/instrument_details/__init__.py +1 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/instrument_details/get_all_instruments.py +303 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/instrument_details/get_instrument.py +170 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/list_accounts/__init__.py +1 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/list_accounts/get_accounts.py +172 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/market_data/__init__.py +1 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/market_data/get_option_chain.py +200 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/market_data/get_option_expirations.py +210 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/market_data/get_quotes.py +200 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/option_details/__init__.py +1 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/option_details/get_option_greeks.py +194 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/order_placement/__init__.py +1 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/order_placement/cancel_order.py +123 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/order_placement/get_order.py +206 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/order_placement/place_multileg_order.py +214 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/order_placement/place_order.py +222 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/order_placement/preflight_multi_leg.py +276 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/order_placement/preflight_single_leg.py +220 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/api/order_placement/replace_order.py +222 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/client.py +272 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/errors.py +16 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/__init__.py +417 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_holdingsystem_core_types_option_price_increment.py +71 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapiauthservice_api_personal_create_access_token_request.py +84 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapiauthservice_api_personal_create_access_token_response.py +61 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapiauthservice_domain_error_error_body.py +70 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings.py +161 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_account_type.py +14 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_brokerage_account_type.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_options_level.py +12 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_response.py +85 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_account_account_settings_trade_permissions.py +11 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_response_page.py +195 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction.py +263 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_direction.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_security_type.py +13 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_side.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_sub_type.py +19 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_history_gateway_history_transaction_type.py +10 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_chain_request.py +85 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_chain_response.py +115 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_expirations_request.py +75 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_option_expirations_response.py +81 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_quote.py +272 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_quote_outcome.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_quote_request.py +84 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_gateway_quote_response.py +87 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_one_day_change.py +74 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_marketdata_quote_option_details.py +135 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_options_greek_response.py +113 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_options_greeks_response.py +86 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_options_option_greeks_type_0.py +117 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_cancel_replace_order_request.py +139 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_cancel_replace_order_request_order_type.py +11 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto.py +265 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_fractional_trading.py +10 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_option_spread_trading.py +10 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_option_trading.py +10 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_shorting_availability.py +10 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_dto_trading.py +10 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_instrument_response.py +87 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_multileg_order_request.py +141 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_multileg_order_request_type.py +11 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request.py +231 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request_equity_market_session.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request_open_close_indicator.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request_order_side.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_request_order_type.py +11 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_api_order_result.py +69 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_leg_instrument.py +73 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_leg_instrument_type.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order.py +334 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_instrument.py +73 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_instrument_type.py +15 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_leg.py +125 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_leg_open_close_indicator.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_leg_side.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_open_close_indicator.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_side.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_status.py +17 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_order_type.py +11 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_short_selling.py +127 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_short_selling_availability.py +10 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_gateway_short_selling_uptick_rule.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_instrumentdetails_api_instrument_details.py +67 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_instrumentdetails_api_instrument_details_bond.py +74 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_instrumentdetails_api_instrument_details_crypto.py +92 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_order_expiration.py +87 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_order_order_expiration_time_in_force.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gain_type_0.py +88 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_buying_power.py +77 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_cost_basis_type_0.py +167 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_account_v2.py +233 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_account_v2_account_type.py +14 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_equity_v2.py +100 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_equity_v2_type.py +14 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_instrument.py +93 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_instrument_type.py +14 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_portfolio_position.py +352 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_strategy.py +276 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_gateway_strategy_leg.py +78 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_portfolio_price_type_0.py +79 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_margin_impact.py +70 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_margin_requirement.py +70 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_option_details.py +91 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_option_details_type.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_option_rebate.py +79 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_price_increment.py +80 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_gateway_regulatory_fees.py +118 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response.py +167 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response_open_close_indicator.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_leg_response_side.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_request.py +148 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_request_order_type.py +11 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_multi_leg_response.py +313 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request.py +225 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request_equity_market_session.py +11 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request_open_close_indicator.py +11 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request_order_side.py +9 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_request_order_type.py +11 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/com_hellopublic_userapigateway_api_rest_preflight_preflight_single_leg_response.py +410 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/get_all_instruments_fractional_trading_filter_item.py +10 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/get_all_instruments_option_spread_trading_filter_item.py +10 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/get_all_instruments_option_trading_filter_item.py +10 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/get_all_instruments_trading_filter_item.py +10 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/get_all_instruments_type_filter_item.py +15 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/models/get_instrument_type.py +15 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/_generated/types.py +54 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/cli.py +761 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/client.py +83 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/config.py +222 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/output.py +77 -0
- publicdotcom_cli-1.0.0/src/publicdotcom_cli/payloads.py +36 -0
- publicdotcom_cli-1.0.0/tests/test_cli.py +11 -0
- publicdotcom_cli-1.0.0/tests/test_client.py +16 -0
- publicdotcom_cli-1.0.0/tests/test_config.py +54 -0
- publicdotcom_cli-1.0.0/tests/test_payloads.py +25 -0
- publicdotcom_cli-1.0.0/uv.lock +622 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
src/publicdotcom_cli/_generated/** linguist-generated=true
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: publicdotcom-cli
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Command-line client for the Public.com Trading API
|
|
5
|
+
Project-URL: Homepage, https://github.com/publicdotcom/publicdotcom-cli
|
|
6
|
+
Project-URL: Repository, https://github.com/publicdotcom/publicdotcom-cli
|
|
7
|
+
Project-URL: Issues, https://github.com/publicdotcom/publicdotcom-cli/issues
|
|
8
|
+
Project-URL: Public.com API, https://public.com/api
|
|
9
|
+
Author-email: "Public.com" <developers@public.com>
|
|
10
|
+
Maintainer-email: "Public.com" <developers@public.com>
|
|
11
|
+
License-Expression: Apache-2.0
|
|
12
|
+
Keywords: api,brokerage,cli,crypto,options,public.com,stocks,trading
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
24
|
+
Classifier: Topic :: Utilities
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: attrs>=23.2.0
|
|
27
|
+
Requires-Dist: httpx>=0.28.0
|
|
28
|
+
Requires-Dist: keyring>=25.0.0
|
|
29
|
+
Requires-Dist: platformdirs>=4.0.0
|
|
30
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
31
|
+
Requires-Dist: rich>=13.7.0
|
|
32
|
+
Requires-Dist: typer>=0.16.0
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: ruff>=0.11.0; extra == 'dev'
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
# publicdotcom-cli
|
|
39
|
+
|
|
40
|
+
Command-line client for the Public.com Trading API.
|
|
41
|
+
|
|
42
|
+
Use `public` to authenticate, inspect accounts, retrieve portfolio and market data, run
|
|
43
|
+
preflight checks, and submit order-related requests from your terminal.
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
The recommended installation method for command-line Python tools is `pipx`:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pipx install publicdotcom-cli
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
You can also install with `uv`:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
uv tool install publicdotcom-cli
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Confirm the CLI is available:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
public --help
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Quick Start
|
|
66
|
+
|
|
67
|
+
Generate a personal secret from your Public.com settings, then authenticate:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
public auth login
|
|
71
|
+
public accounts list
|
|
72
|
+
public accounts set-default ACCOUNT_ID
|
|
73
|
+
public portfolio show
|
|
74
|
+
public market quotes AAPL MSFT
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Most account-scoped commands use the configured default account. You can override it with
|
|
78
|
+
`--account-id ACCOUNT_ID` or `PUBLIC_ACCOUNT_ID=ACCOUNT_ID`.
|
|
79
|
+
|
|
80
|
+
## Important Disclosures
|
|
81
|
+
|
|
82
|
+
This CLI is a developer tool for interacting with the Public API. It is not investment,
|
|
83
|
+
financial, legal, tax, accounting, or trading advice, and it does not recommend any
|
|
84
|
+
security, strategy, account type, order type, or transaction.
|
|
85
|
+
|
|
86
|
+
Trading involves risk, including the possible loss of principal. You are responsible for
|
|
87
|
+
reviewing all request payloads, account IDs, symbols, quantities, prices, order sides,
|
|
88
|
+
time-in-force values, and other order instructions before submitting a trading command.
|
|
89
|
+
|
|
90
|
+
Order placement, replacement, and cancellation requests may be asynchronous. A successful
|
|
91
|
+
API response confirms submission to the API, not execution, cancellation, fill price,
|
|
92
|
+
availability, or final order state. Always verify order status after submitting,
|
|
93
|
+
replacing, or cancelling an order.
|
|
94
|
+
|
|
95
|
+
Market data, quotes, option chains, greeks, account data, and preflight calculations are
|
|
96
|
+
provided for informational and operational use through the API. They may be incomplete,
|
|
97
|
+
delayed, unavailable, or different from final execution values.
|
|
98
|
+
|
|
99
|
+
You are responsible for complying with all applicable laws, regulations, exchange rules,
|
|
100
|
+
API terms, account agreements, and internal policies that apply to your use of this CLI.
|
|
101
|
+
Do not use this tool unless you are authorized to access the relevant account and API
|
|
102
|
+
credentials.
|
|
103
|
+
|
|
104
|
+
Personal secrets and access tokens can authorize account access and trading activity.
|
|
105
|
+
Keep them private, do not commit them to source control, and rotate or revoke them if
|
|
106
|
+
you believe they were exposed.
|
|
107
|
+
|
|
108
|
+
## Authenticate
|
|
109
|
+
|
|
110
|
+
Generate a personal secret from Public, then run:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
public auth login
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The access token is stored with your OS keychain when available. If no keychain backend
|
|
117
|
+
is available, the CLI falls back to a user-only config file.
|
|
118
|
+
|
|
119
|
+
Access tokens are short-lived. To let the CLI refresh them automatically, opt in to
|
|
120
|
+
storing your personal secret:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
public auth login --store-secret
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Because the personal secret is long-lived, this is optional. The CLI stores it in your
|
|
127
|
+
OS keychain when available, otherwise it falls back to a user-only config file.
|
|
128
|
+
|
|
129
|
+
After that, secured commands automatically mint a fresh access token before the current
|
|
130
|
+
token expires or after a `401 Unauthorized` response. You can also refresh manually:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
public auth refresh
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
You can also bypass stored credentials for automation:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
PUBLIC_ACCESS_TOKEN=ey... public accounts list
|
|
140
|
+
PUBLIC_PERSONAL_SECRET=... public accounts list
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Remove stored credentials with:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
public auth logout
|
|
147
|
+
public auth logout --all
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Default Account
|
|
151
|
+
|
|
152
|
+
Most API operations require the `accountId` returned by `public accounts list`. You can
|
|
153
|
+
store a default account once:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
public accounts set-default ACCOUNT_ID
|
|
157
|
+
public accounts get-default
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Then omit `--account-id` from account-scoped commands:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
public portfolio show
|
|
164
|
+
public market quotes AAPL MSFT
|
|
165
|
+
public order get ORDER_ID
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
You can override the default at any time:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
public portfolio show --account-id ACCOUNT_ID
|
|
172
|
+
PUBLIC_ACCOUNT_ID=ACCOUNT_ID public portfolio show
|
|
173
|
+
public accounts clear-default
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Example Commands
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
public accounts list
|
|
180
|
+
public accounts set-default ACCOUNT_ID
|
|
181
|
+
public portfolio show
|
|
182
|
+
public history list --page-size 25
|
|
183
|
+
public instruments get AAPL EQUITY
|
|
184
|
+
public market quotes AAPL MSFT --type EQUITY
|
|
185
|
+
public market option-expirations AAPL
|
|
186
|
+
public market option-chain AAPL 2026-05-15
|
|
187
|
+
public options greeks "AAPL 260515C00200000"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Trading requests use JSON files so the exact payload is visible before submission:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
public order preflight-single --file examples/order.single-leg.market-buy.json
|
|
194
|
+
public order place --file examples/order.single-leg.market-buy.json
|
|
195
|
+
public order get ORDER_ID
|
|
196
|
+
public order cancel ORDER_ID
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Trading commands prompt before submitting order placement, replacement, or cancellation
|
|
200
|
+
requests. Use `--yes` only when your automation has already performed equivalent
|
|
201
|
+
validation and approval.
|
|
202
|
+
|
|
203
|
+
## JSON Output
|
|
204
|
+
|
|
205
|
+
Use `--json` before the command group to print raw JSON:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
public --json accounts list
|
|
209
|
+
public --json market quotes AAPL MSFT
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Configuration
|
|
213
|
+
|
|
214
|
+
The CLI supports these environment variables:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
PUBLIC_ACCESS_TOKEN=...
|
|
218
|
+
PUBLIC_PERSONAL_SECRET=...
|
|
219
|
+
PUBLIC_ACCOUNT_ID=...
|
|
220
|
+
PUBLIC_API_BASE_URL=https://api.public.com
|
|
221
|
+
PUBLIC_AUTO_REFRESH=true
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`PUBLIC_API_BASE_URL` is optional and defaults to `https://api.public.com`.
|
|
225
|
+
|
|
226
|
+
## Upgrade
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
pipx upgrade publicdotcom-cli
|
|
230
|
+
# or
|
|
231
|
+
uv tool upgrade publicdotcom-cli
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Development
|
|
235
|
+
|
|
236
|
+
For local development from a checkout:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
uv sync --extra dev
|
|
240
|
+
uv run public --help
|
|
241
|
+
uv run pytest
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Regenerate The OpenAPI Client
|
|
245
|
+
|
|
246
|
+
The package ships with a generated API client. Contributors who need to regenerate it
|
|
247
|
+
must place the local OpenAPI spec at the repository root as `spec.yaml`, then run:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
uv run python scripts/generate_client.py
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
The raw spec uses `*/*` for many JSON responses, which some Python generators do not
|
|
254
|
+
parse as JSON. The regeneration script normalizes those response content types before
|
|
255
|
+
running `openapi-python-client`. This requires network access the first time because it
|
|
256
|
+
uses `uvx openapi-python-client`.
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# publicdotcom-cli
|
|
2
|
+
|
|
3
|
+
Command-line client for the Public.com Trading API.
|
|
4
|
+
|
|
5
|
+
Use `public` to authenticate, inspect accounts, retrieve portfolio and market data, run
|
|
6
|
+
preflight checks, and submit order-related requests from your terminal.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
The recommended installation method for command-line Python tools is `pipx`:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pipx install publicdotcom-cli
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
You can also install with `uv`:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
uv tool install publicdotcom-cli
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Confirm the CLI is available:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
public --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
Generate a personal secret from your Public.com settings, then authenticate:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
public auth login
|
|
34
|
+
public accounts list
|
|
35
|
+
public accounts set-default ACCOUNT_ID
|
|
36
|
+
public portfolio show
|
|
37
|
+
public market quotes AAPL MSFT
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Most account-scoped commands use the configured default account. You can override it with
|
|
41
|
+
`--account-id ACCOUNT_ID` or `PUBLIC_ACCOUNT_ID=ACCOUNT_ID`.
|
|
42
|
+
|
|
43
|
+
## Important Disclosures
|
|
44
|
+
|
|
45
|
+
This CLI is a developer tool for interacting with the Public API. It is not investment,
|
|
46
|
+
financial, legal, tax, accounting, or trading advice, and it does not recommend any
|
|
47
|
+
security, strategy, account type, order type, or transaction.
|
|
48
|
+
|
|
49
|
+
Trading involves risk, including the possible loss of principal. You are responsible for
|
|
50
|
+
reviewing all request payloads, account IDs, symbols, quantities, prices, order sides,
|
|
51
|
+
time-in-force values, and other order instructions before submitting a trading command.
|
|
52
|
+
|
|
53
|
+
Order placement, replacement, and cancellation requests may be asynchronous. A successful
|
|
54
|
+
API response confirms submission to the API, not execution, cancellation, fill price,
|
|
55
|
+
availability, or final order state. Always verify order status after submitting,
|
|
56
|
+
replacing, or cancelling an order.
|
|
57
|
+
|
|
58
|
+
Market data, quotes, option chains, greeks, account data, and preflight calculations are
|
|
59
|
+
provided for informational and operational use through the API. They may be incomplete,
|
|
60
|
+
delayed, unavailable, or different from final execution values.
|
|
61
|
+
|
|
62
|
+
You are responsible for complying with all applicable laws, regulations, exchange rules,
|
|
63
|
+
API terms, account agreements, and internal policies that apply to your use of this CLI.
|
|
64
|
+
Do not use this tool unless you are authorized to access the relevant account and API
|
|
65
|
+
credentials.
|
|
66
|
+
|
|
67
|
+
Personal secrets and access tokens can authorize account access and trading activity.
|
|
68
|
+
Keep them private, do not commit them to source control, and rotate or revoke them if
|
|
69
|
+
you believe they were exposed.
|
|
70
|
+
|
|
71
|
+
## Authenticate
|
|
72
|
+
|
|
73
|
+
Generate a personal secret from Public, then run:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
public auth login
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The access token is stored with your OS keychain when available. If no keychain backend
|
|
80
|
+
is available, the CLI falls back to a user-only config file.
|
|
81
|
+
|
|
82
|
+
Access tokens are short-lived. To let the CLI refresh them automatically, opt in to
|
|
83
|
+
storing your personal secret:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
public auth login --store-secret
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Because the personal secret is long-lived, this is optional. The CLI stores it in your
|
|
90
|
+
OS keychain when available, otherwise it falls back to a user-only config file.
|
|
91
|
+
|
|
92
|
+
After that, secured commands automatically mint a fresh access token before the current
|
|
93
|
+
token expires or after a `401 Unauthorized` response. You can also refresh manually:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
public auth refresh
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
You can also bypass stored credentials for automation:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
PUBLIC_ACCESS_TOKEN=ey... public accounts list
|
|
103
|
+
PUBLIC_PERSONAL_SECRET=... public accounts list
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Remove stored credentials with:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
public auth logout
|
|
110
|
+
public auth logout --all
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Default Account
|
|
114
|
+
|
|
115
|
+
Most API operations require the `accountId` returned by `public accounts list`. You can
|
|
116
|
+
store a default account once:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
public accounts set-default ACCOUNT_ID
|
|
120
|
+
public accounts get-default
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Then omit `--account-id` from account-scoped commands:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
public portfolio show
|
|
127
|
+
public market quotes AAPL MSFT
|
|
128
|
+
public order get ORDER_ID
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
You can override the default at any time:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
public portfolio show --account-id ACCOUNT_ID
|
|
135
|
+
PUBLIC_ACCOUNT_ID=ACCOUNT_ID public portfolio show
|
|
136
|
+
public accounts clear-default
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Example Commands
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
public accounts list
|
|
143
|
+
public accounts set-default ACCOUNT_ID
|
|
144
|
+
public portfolio show
|
|
145
|
+
public history list --page-size 25
|
|
146
|
+
public instruments get AAPL EQUITY
|
|
147
|
+
public market quotes AAPL MSFT --type EQUITY
|
|
148
|
+
public market option-expirations AAPL
|
|
149
|
+
public market option-chain AAPL 2026-05-15
|
|
150
|
+
public options greeks "AAPL 260515C00200000"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Trading requests use JSON files so the exact payload is visible before submission:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
public order preflight-single --file examples/order.single-leg.market-buy.json
|
|
157
|
+
public order place --file examples/order.single-leg.market-buy.json
|
|
158
|
+
public order get ORDER_ID
|
|
159
|
+
public order cancel ORDER_ID
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Trading commands prompt before submitting order placement, replacement, or cancellation
|
|
163
|
+
requests. Use `--yes` only when your automation has already performed equivalent
|
|
164
|
+
validation and approval.
|
|
165
|
+
|
|
166
|
+
## JSON Output
|
|
167
|
+
|
|
168
|
+
Use `--json` before the command group to print raw JSON:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
public --json accounts list
|
|
172
|
+
public --json market quotes AAPL MSFT
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Configuration
|
|
176
|
+
|
|
177
|
+
The CLI supports these environment variables:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
PUBLIC_ACCESS_TOKEN=...
|
|
181
|
+
PUBLIC_PERSONAL_SECRET=...
|
|
182
|
+
PUBLIC_ACCOUNT_ID=...
|
|
183
|
+
PUBLIC_API_BASE_URL=https://api.public.com
|
|
184
|
+
PUBLIC_AUTO_REFRESH=true
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
`PUBLIC_API_BASE_URL` is optional and defaults to `https://api.public.com`.
|
|
188
|
+
|
|
189
|
+
## Upgrade
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
pipx upgrade publicdotcom-cli
|
|
193
|
+
# or
|
|
194
|
+
uv tool upgrade publicdotcom-cli
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Development
|
|
198
|
+
|
|
199
|
+
For local development from a checkout:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
uv sync --extra dev
|
|
203
|
+
uv run public --help
|
|
204
|
+
uv run pytest
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Regenerate The OpenAPI Client
|
|
208
|
+
|
|
209
|
+
The package ships with a generated API client. Contributors who need to regenerate it
|
|
210
|
+
must place the local OpenAPI spec at the repository root as `spec.yaml`, then run:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
uv run python scripts/generate_client.py
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
The raw spec uses `*/*` for many JSON responses, which some Python generators do not
|
|
217
|
+
parse as JSON. The regeneration script normalizes those response content types before
|
|
218
|
+
running `openapi-python-client`. This requires network access the first time because it
|
|
219
|
+
uses `uvx openapi-python-client`.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "publicdotcom-cli"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = "Command-line client for the Public.com Trading API"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
license = "Apache-2.0"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "Public.com", email = "developers@public.com" },
|
|
10
|
+
]
|
|
11
|
+
maintainers = [
|
|
12
|
+
{ name = "Public.com", email = "developers@public.com" },
|
|
13
|
+
]
|
|
14
|
+
keywords = [
|
|
15
|
+
"api",
|
|
16
|
+
"brokerage",
|
|
17
|
+
"cli",
|
|
18
|
+
"crypto",
|
|
19
|
+
"options",
|
|
20
|
+
"public.com",
|
|
21
|
+
"stocks",
|
|
22
|
+
"trading",
|
|
23
|
+
]
|
|
24
|
+
classifiers = [
|
|
25
|
+
"Development Status :: 4 - Beta",
|
|
26
|
+
"Environment :: Console",
|
|
27
|
+
"Intended Audience :: Developers",
|
|
28
|
+
"License :: OSI Approved :: Apache Software License",
|
|
29
|
+
"Operating System :: OS Independent",
|
|
30
|
+
"Programming Language :: Python :: 3",
|
|
31
|
+
"Programming Language :: Python :: 3.10",
|
|
32
|
+
"Programming Language :: Python :: 3.11",
|
|
33
|
+
"Programming Language :: Python :: 3.12",
|
|
34
|
+
"Programming Language :: Python :: 3.13",
|
|
35
|
+
"Topic :: Office/Business :: Financial :: Investment",
|
|
36
|
+
"Topic :: Utilities",
|
|
37
|
+
]
|
|
38
|
+
dependencies = [
|
|
39
|
+
"attrs>=23.2.0",
|
|
40
|
+
"httpx>=0.28.0",
|
|
41
|
+
"keyring>=25.0.0",
|
|
42
|
+
"platformdirs>=4.0.0",
|
|
43
|
+
"python-dateutil>=2.8.2",
|
|
44
|
+
"rich>=13.7.0",
|
|
45
|
+
"typer>=0.16.0",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[project.optional-dependencies]
|
|
49
|
+
dev = [
|
|
50
|
+
"pytest>=8.0.0",
|
|
51
|
+
"ruff>=0.11.0",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[project.scripts]
|
|
55
|
+
public = "publicdotcom_cli.cli:main"
|
|
56
|
+
|
|
57
|
+
[project.urls]
|
|
58
|
+
Homepage = "https://github.com/publicdotcom/publicdotcom-cli"
|
|
59
|
+
Repository = "https://github.com/publicdotcom/publicdotcom-cli"
|
|
60
|
+
Issues = "https://github.com/publicdotcom/publicdotcom-cli/issues"
|
|
61
|
+
"Public.com API" = "https://public.com/api"
|
|
62
|
+
|
|
63
|
+
[build-system]
|
|
64
|
+
requires = ["hatchling>=1.24.0"]
|
|
65
|
+
build-backend = "hatchling.build"
|
|
66
|
+
|
|
67
|
+
[tool.hatch.build.targets.wheel]
|
|
68
|
+
packages = ["src/publicdotcom_cli"]
|
|
69
|
+
|
|
70
|
+
[tool.ruff]
|
|
71
|
+
line-length = 100
|
|
72
|
+
target-version = "py310"
|
|
73
|
+
extend-exclude = ["src/publicdotcom_cli/_generated"]
|
|
74
|
+
|
|
75
|
+
[tool.pytest.ini_options]
|
|
76
|
+
testpaths = ["tests"]
|
|
77
|
+
pythonpath = ["src"]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
import shutil
|
|
5
|
+
import subprocess
|
|
6
|
+
import tempfile
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
ROOT = Path(__file__).resolve().parents[1]
|
|
10
|
+
SPEC_PATH = ROOT / "spec.yaml"
|
|
11
|
+
OUTPUT_PATH = ROOT / "src" / "publicdotcom_cli" / "_generated"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def normalized_spec_text() -> str:
|
|
15
|
+
if not SPEC_PATH.exists():
|
|
16
|
+
raise SystemExit(
|
|
17
|
+
f"OpenAPI spec not found at {SPEC_PATH}. "
|
|
18
|
+
"Place the local, uncommitted spec at the repository root as spec.yaml."
|
|
19
|
+
)
|
|
20
|
+
text = SPEC_PATH.read_text(encoding="utf-8")
|
|
21
|
+
return re.sub(r"^(\s*)'\*/\*':", r"\1application/json:", text, flags=re.MULTILINE)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def main() -> None:
|
|
25
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
26
|
+
normalized_spec = Path(tmp) / "spec.codegen.yaml"
|
|
27
|
+
normalized_spec.write_text(normalized_spec_text(), encoding="utf-8")
|
|
28
|
+
subprocess.run(
|
|
29
|
+
[
|
|
30
|
+
"uvx",
|
|
31
|
+
"openapi-python-client",
|
|
32
|
+
"generate",
|
|
33
|
+
"--path",
|
|
34
|
+
str(normalized_spec),
|
|
35
|
+
"--output-path",
|
|
36
|
+
str(OUTPUT_PATH),
|
|
37
|
+
"--overwrite",
|
|
38
|
+
"--meta",
|
|
39
|
+
"none",
|
|
40
|
+
],
|
|
41
|
+
check=True,
|
|
42
|
+
cwd=ROOT,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
shutil.rmtree(OUTPUT_PATH / ".ruff_cache", ignore_errors=True)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
if __name__ == "__main__":
|
|
49
|
+
main()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains methods for accessing the API"""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|