mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 04:31:13 +00:00
* add snowflake integration video (#6339) * [HotFix] Fix broken URLs in docs page. (#6368) * Fix broken URLs * use full URL to other docs pages. * [Release] 4.2.0 (#6422) * [Docs] Remove Reference to `to_chart` in OBBject. (#6096) * remove reference to to_chart in OBBject. * put chart description back in OBBject properties * [Feature] - Create openbb assets folder (#6101) * create openbb assets folder * fix unittest * rebuild --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * [BugFix] Fixes to_df() where the date series contains multiple TZ-offsets. (#6099) * allow mixed utc offset in a tz-aware date column * enforce ascending from all providers for price.historical * fix tests * add comments and apply treatment to basemodel_from_df before JSON output * yfinance consistency * add unit test * add unit test * better test * ruff --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * Update the quantitative extension to make more sense (#6087) * Split out a rolling submenu for the rolling functions * Make a performance and a stats submenu. * Test the statistics functions * lint * lint * dupe test * pylint * ruff * Try tests quick * black magic signature funcs * fix my custom tests * Fix the existing imports/urls * push the api update * okay I figured out whats going on * this should be all of them * Correct docstringing examples --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * [BugFix] Fix ECB Yield Curve (#6108) * fix ecb yield curve * standard model update * Update unit-test workflow to check for changes to openbb_platform (#6109) * [Bug fix] - Fix package mypy (#6110) * fix: package mypy * types * black * [Feature] - Equity router descriptions & examples (#6103) * feat: equity/calendar * feat: compare router * fix descriptions * darkpool + discovery * fix paragraph issues * fix descriptions * fundamental part 1 * fundamental part2 * transcipts * ownership * fix * price * shorts * Update darkpool_router.py * minor fix * shorts examples * examples * ruff * black --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * [Feature] - Add `exception_handler` decorator to static (#6112) * add exception handler decorator * add exception handler decorator code * updated static * rebuild to fix docstring indentation --------- Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> * update extensions list (#6114) * add missing field descriptions to yfinance equity price historical (#6116) Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * remove charting extension env var (#6118) * [BugFix] Fix Company News (#6111) * fix company news * update tests * multiple symbols for polygon * don't include pageSize in Benzinga querystring, fixed as 100 * remove extra space * black * unused imports * make benzinga test cassette smaller * missing params * clear empty strings --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * [BugFix] Allow Multiple Symbols in `equity.fundamental.metrics()` from `yfinance` (#6124) * allow multiple symbols in key_metrics from yfinance * field order thing * remove unnecessary function (#6125) * [Docs] Update OpenBB Copilot docs (#6106) * WIP: Tweak description. * WIP: Experimenting with react-player * WIP: Add copilot docs. * fixes videos width/height * WIP: Refine videos and copy. * WIP: Add last videos and sections. * Add bring-your-own-copilot section. * Tweak grammar. * Add copilot link. * Fix typos. --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * [Enhancement] Add Previous Close to DATA_DESCRIPTIONS (#6120) * add data description for previous close * ..just the one * update the model tripped by this change --------- Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> * added australia as a country also (#6131) * [Bug fix] - Fix regulator cik map standard model (#6129) * Fix regulator cik map standard model * fix description * Update cik_map.py * increase timeout to 30 (#6115) Co-authored-by: James Maslek <jmaslek11@gmail.com> * clean up some v3 deps (#6105) * clean up some v3 deps * forgot we need to do the requirements txt files * not sure it matters, but run ruff + black * am addicted to bug fixes --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * [Bug fix] - explicit multiple items docstring (#6127) * explicit multiple items docstring * rebuiild * rebuild again --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * [Feature] Pretty Pydantic `ValidationError` exceptions (#6130) * fix validator in fmp IndexHistorical model * make ValidationError pretty * modify arg error * linting fmp IndexHistorical * black * remove unused code * tmx etf info (#6132) Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> * [Feature] - Platform V4 Markdown Generator V2 (#6094) * add recent `openapi.json` * fix data types in models * removed `openapi.json` * set default date value as None in PolygonCurrencyPairs class * add function to generate reference.json file * reworked function to improve readability * reword function to add seo metadata * add functions for creating markdown sections * add code to extract data card markdown title * add additional functions for generating index and data models file * extract first sentence of the description for cards * code cleanup and documentation * linting * linting polygon models * add openbb import statement in create_reference_markdown_examples function * add POST method functions * cleanup; reworked generate_reference_index_files function * moved development section to 7th position in the sidebar * fix POST function params default value add standard flag to QueryParams and Data fields cleanup * add type expansion from package_builder.MethodDefinition * sort data models cards alphabetically make printing less verbose * make MAX_CARDS global display less content in cards in Commannds section * cleanup * Remove '_' from the cards under Commands section * " to ' in econometrics/causality * replace ' with " in ReferenceCard for reference dir index files * remove extra . from the quantile function description * shoutout to @deeleeramone for finding POST method description bug! * set correct value for standard field * handle BaseModel types in provider data fields * unit tests for the platform markdown generator v2 * yeet 'Default' and 'Optional' columns in the 'Data' section * last minute bug fix * add info for multiple symbols * make multiple items info same as platform static * organize sections properly * sort reference sub-directories alphabetically * extra space in 'OBBject extra' description * add type expansion for fields with multiple items POST method cleanup --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * [Docs] Adds Example Notebook for the Implied Earnings Move (#6128) * adds example notebook for the implied earnings move * remove commented out line --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * [Feature] - Sync with new openapi.json (#6137) * feat: create data tabs * fix: uncomment * fix: remove unecessary comment * sort side bar * comment * uncomment * use .dev functions.json + clean traverse * fix futures example * fix example * point to .co * Fix the v3 markdown generation workflow (#6138) * fix workflow * debug time * see if the docs generate at least * ahhhh i found it * getting there * put the test first * some keys cleanup * small change to error message * update functions.json (#6140) * fix intraday check in charting ta_class (#6119) Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> * [BugFix] Display EconDB as source for macro (#6143) * [BugFix] Disable Intrinio `InstitutionalOwnership` model (#6142) * disable fetcher in init and fetcher tests * disable provider test params from equity python and api tests * updated static * add more examples into findSymbols (#6139) Co-authored-by: James Maslek <jmaslek11@gmail.com> * [BugFix] Fix SEC ETF Holdings Parsing Exception (#6121) * fix etf holdings * linting * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Docs/update xl docs (#6145) * remove print * update obb.get docs * example * md lint * fix get reference (#6147) * [BugFix] Filter OECD data using `start_date` and `end_date` parameters (#6144) * move constant dicts to constants.py filter by start_date and end_date * black * black again again * Merge 'main' into 'develop' (#6151) * Release/3.2.4 (#5696) * test * ultima description (#5541) * Updating showcase page (#5543) * updating showcase page * use sdk instead * add new bot command autopost docs (#5530) add new bot command autopost docs to docs.openbb.co Co-authored-by: James Maslek <jmaslek11@gmail.com> * Hotfix/ultima improvements (#5553) * tweaks for monetization * fix linting issue * fix: Modify 'load' behavior to append data to existing sheet (#5503) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Fixed 'worksheet not found' error during export to an existing sheet * Changes: * Now if the sheet exists in the xlsx file it will ask the user if he wants to replace/append/create new sheet --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * added platform API integration test to Nightly build (#5571) * Add columns to `stocks/search` (#5565) * Add columns to `stocks/search` isin, cusip, figi, composite_figi, shareclass_figi * Update test_search[False].txt * Update test_search[True].txt * Delete tests/openbb_terminal/stocks/cassettes/test_stocks_helper/test_search.yaml * Create test_search.yaml --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * updating ultima urls (#5587) * fix: A value is trying to be set on a copy of a slice from a DataFrame #5582 (#5591) * Update README.md (#5598) * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * fix docs (#5646) * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update settings.md (#5665) * fix front matter (#5667) * #5633 adding comma every 1000 (#5652) * #5633 adding comma every 1000 * pylint --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Hotfix/reports model render report sanitize inputs (#5669) * Adding more robust special character handling to create_output_path().Addresses https://github.com/OpenBB-finance/OpenBBTerminal/issues/5299 * Running black linter on code to conform to OBB style guides. --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * hotfix/fix-gov-histcont: Fix #5650 - /stocks/gov/histcont (#5676) * fix histcont * some cleanup * remove sort line * 12-31 not 12-12 * columns_keep_types * remove space in regex (#5675) * Pin openai (#5685) * Clarified stocks/ta empty recom object message (#5468) * Clarified stocks/ta empty recom object message * black * lint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * improved market cap value extraction (#5169) * improved market cap value extraction * pylint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * 3.2.3->3.2.4 * Changelogs * new changelog --------- Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Andrew <andrew.kenreich@gmail.com> Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Luqman <luqazino@gmail.com> Co-authored-by: Adwait <111136306+AdwaitSalankar@users.noreply.github.com> Co-authored-by: Abhishek Amar <66067391+abhishek-amar@users.noreply.github.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Ramazan <guvencramazan@outlook.com> Co-authored-by: joshuabuildsthings <joshuabuildsthings@users.noreply.github.com> Co-authored-by: wojda <114031148+polooner@users.noreply.github.com> Co-authored-by: Bim Phomthong <118195204+bimbolimbo@users.noreply.github.com> * Release/4.0.1 (#5840) * test * ultima description (#5541) * Updating showcase page (#5543) * updating showcase page * use sdk instead * add new bot command autopost docs (#5530) add new bot command autopost docs to docs.openbb.co Co-authored-by: James Maslek <jmaslek11@gmail.com> * Hotfix/ultima improvements (#5553) * tweaks for monetization * fix linting issue * fix: Modify 'load' behavior to append data to existing sheet (#5503) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Fixed 'worksheet not found' error during export to an existing sheet * Changes: * Now if the sheet exists in the xlsx file it will ask the user if he wants to replace/append/create new sheet --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * added platform API integration test to Nightly build (#5571) * Add columns to `stocks/search` (#5565) * Add columns to `stocks/search` isin, cusip, figi, composite_figi, shareclass_figi * Update test_search[False].txt * Update test_search[True].txt * Delete tests/openbb_terminal/stocks/cassettes/test_stocks_helper/test_search.yaml * Create test_search.yaml --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * updating ultima urls (#5587) * fix: A value is trying to be set on a copy of a slice from a DataFrame #5582 (#5591) * Update README.md (#5598) * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * fix docs (#5646) * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update settings.md (#5665) * fix front matter (#5667) * #5633 adding comma every 1000 (#5652) * #5633 adding comma every 1000 * pylint --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Hotfix/reports model render report sanitize inputs (#5669) * Adding more robust special character handling to create_output_path().Addresses https://github.com/OpenBB-finance/OpenBBTerminal/issues/5299 * Running black linter on code to conform to OBB style guides. --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * hotfix/fix-gov-histcont: Fix #5650 - /stocks/gov/histcont (#5676) * fix histcont * some cleanup * remove sort line * 12-31 not 12-12 * columns_keep_types * remove space in regex (#5675) * Pin openai (#5685) * Clarified stocks/ta empty recom object message (#5468) * Clarified stocks/ta empty recom object message * black * lint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * improved market cap value extraction (#5169) * improved market cap value extraction * pylint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Release/3.2.4 (#5704) * 3.2.3->3.2.4 * Changelogs * new changelog * OpenBB Platform v4 (#5225) * change location * check something * add cache * fixed auth w/@IgorWounds and @montezdesousa * fixes for econometrics * include Darren auth suggestions * some routers included if dev + chg hub backend var * coverage router should not be here * update docker readme * forgot to check auth here * Change extension imports * update docstrings and readme * headers function wasnt being called, just referenced * relative import * econometrics add headers everywhere * Fix QA * Fix TA * Fix test * Fix python interface QA and TA * Lint * Cleanup * Change path * make the changes and some etf models * tests for command_runner * ruff * solving naming issues on pytest * Update some docstrings, fix typos and lint * solving econometrics instantiating wrong openbb * chaging the way pytest runs * messing around with the imports * ruff * Change template to add platform considerations (#5533) * change template to add platform considerations * @the-praxs suggestions * solving __pycache__ issue * removing typo * ci yml * making linters happy (i guess) * Improve Omega Ratio and docstrings * chaging pro validation hash * ruff * Fix OLS Summary and lint * Add OECD Provider for economy extension (#5534) * Add record to docs * update a couple of cboe models * Fix econometrics bugs. Make tests pass. Lint. * black * ruff * pydantic v2: remove deprecated Extra * pydantic v2: self.dict -> self.model_dump * revert pydantic * revert the revert * try 1: pin urllib3 < 2 * Revert "try 1: pin urllib3 < 2" This reverts commit3736c311cb. * Revert dep * Fix * re-lock * Skip all tests when doing cspell in pre-commit * Resolve linter errors * Add OECD to install script * Add OECD * Resolve more linter errors * Exclude static files of v4 python from ruff * More linting * Another attempt to resolve even more linting errors * Change how Literal is used * ticker. symbol. consistent. @piiq * change ticker field in Stock Search to is_symbol * Update Cboe model for stocks_search -> is_symbol parameter. * Fix issue * Lint * Small QA to rename SDK to Platform (#5544) * SDK -> Platform in docs * renamed in core * renamed in openbb `init` * `sdk` variable renamed as `platform` --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * `validator` -> `field_validator` in standard models * Standard convention for multi-ticker symbols (#5549) * standardize symbol input param in forex and crypto historical data * static * linting * Fix stock_search integration test params * Update dependencies and linting on the CI (#5550) * Remove ruff and black from platform dependencies * Update codespell configuration * Lint python code * Add toml and tomli to root dev dependencies * Update requirements.txt files * Fix buggy docstring in python package methods (#5548) * fix buggy docstring for methods * remove space * fix typing * avoid name collision with validator * Revert "avoid name collision with validator" This reverts commit8a30a44555. * typing * rebuild * python 3.8, ParamSpec not available * lint * ruff noqa * Merge with develop (#5551) * Charting extension integration tests (#5547) * initial proposal for integration tests on the charting extension * int tests for charting generation * python generator * ruff * boilerplate templates * python tests * tests for the api * using body instead so data don't get redefined * unit tests for coverage * ruff * docstrings * unnecessary access to keys() * Add trading economics economic calendar * dev install * Data Models disposition on the website (#5538) * pydantic v4 * flat structure * md files * Revert "md files" This reverts commitbd2170e2ad. * improve command descriptions * nice title and description * human readble data model names on left panel * implementation details section * content markdown files * markdown versioned files * showcase page * updates --------- Co-authored-by: tehcoderer <me@tehcoderer.com> * everything except tests * fix `datetime.date` import in fetcher test * modified url to remove `api_key` placeholder * record test * api key is called c here * fixed fetcher test for api key * recorded tests * refactor * life is ruff * codespell * Make Intrinio options chains great again (#5540) * add multithreading * cleanup * linting * use dateutil.parser * removed `TICKER_EXCEPTIONS` * modified `date` and `type` fields in standard model * set alias for `date` and `type` to match standards * static * static * Hotfix/fix post tests (#5555) * Fix econometrics * Fix ta * Fix qa. Remove intrinio to not be rate limited * Lint * Fix typo * obbject tests (#5558) * obbject tests * ruff * fix dev_install * fix unittests * black on nox * black on nox * nox * fix fetcher test so it can compare dates * fix intrinio tests * ruff * change to model_dum() instead (#5561) * Passing tests (#5560) * Passing tests * fix options * Fix most tests and bugs * fix forex missing params * make symbol upper in polygon fx pairs * fix fixedincome integration tests (#5564) * Fixing charting api integration tests (#5562) * fixing charting api integration tests * black * fix stocks less five API fails * fix the 5 failing stocks integration tests * recapture fmp stock news unit test * fix fmp forex api test * couple more forex integration fixes * changing the request to always use the legacy session. @jmaslek this is was broken for 3.8 and 3.9; with this change apparently all versions work - lemme know if you see any issue with this change * ruff * fix ta * add missing param * fix testers for the api * fix globalnews to use images instead of image * remove unncessary pandas import * econcal int tests * update gitignore * fix get_querystring to support lists * add missing parameters --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> * Stock Historical standardization and UX improvements (#5457) * polygon add interval standard param * attempt at standardization * Alpha Vantage params standardization * rename `get_intervals` and fixed bug for extracting wrong value * missed changing it in `extract_data` * linting * polygon cleanup * modified `start_date` & `end_date` type to `datetime` from `dateType` * standardized intrinio stock historical params * fixed yfinance * linting * revert start and end date to dateType from datetime * fix alpha vantage * changed param * fix intrinio infinite loop * `validator` is `field_validator` * revert time params and fixed intervals * `outputsize` alias set in `Field` * set interval description using in-build dict * yfinance stock param standardization * static * intrinio cleanup * Polygon add api params as `PrivateAttr` * modified yfinance params to `PrivateAttr` * intrinio remove overriding date params * fixed description for AV adjusted param * fix alpha vantage intraday not working * re-record and pass unit tests * pass integration tests * Update test --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * Fix econcal endpoint (#5567) * fix econcal for python interface * fix econcal tests * fix non supported json output * Fixes FMP index endpoint to get 1 day interval data (#5535) * fix FMP endpoint for getting index data for `1day` interval * fix `open` type to prevent validation error * modifed `validator` to `field_validator` * type of fields is `StrictFloat` * re-record and pass test * linting * `validator` -> `field_validator`, a3'd everything * Fix regression in tests. Lint * updating the integration test actions * Fix typo * Fix typo * Fix import * Publish versions `a3` to Pypi (#5568) * bump versions and script to publish * small improvements * uncomment exception * openbb * publishing guidelines * improve docs * add providers to economy api * make symbol required in stock_quote * Fix keys * Fix oecd * add comma * revert * Add quotes * Sleep * Improve tests * Improve * Feature/query transform (#5566) * inject query into transform_data * swap query and data * update missing fetchers * last test failing * sig test fetcher * black * av add `query` to `transform_data` call * transform_data: missing refactoring * fix uvicorn command in the doc * Automated examples (#5576) * Automated examples * Fix bug * Lint * static assets built on 3.8 * Revert "static assets built on 3.8" This reverts commitfb82ff7bd9. * remove assets * static assets on 3.8 * static assets on 3.8 * Wrap in quotes * Improve wrap * minor fix * rebuild 3.8 * Fix bug * Fix edge case * Lint * rebuild --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> * use SecretStr for sensitive fields (#5578) * use SecretStr for sensitive fields * fix * docstring * Add tests for provider (#5583) * Add tests for provider * Test standard models * Lint * Fix standard model issues. Co-authored-by: @the-praxs * linting * `symbol` -> `is_symbol` in `economy.index_search` * static --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * feature/v4-biztoc-provider: Adds Biztoc provider and GlobalNews (#5546) * add biztoc provider * duplicate field * black * request headers * recapture test * move stuff around * add integration tests * duplicate OECD entry in dev_install * duplicate entry for oecd in pyproject.toml * Add Biztoc to workflow * update readme: credentials * Add Preferences to README * improve tests * fix biztoc * obbject pylint * Bug fix: serializ SecretStr before dumping to json * export credentials as json (#5592) * Check for wrong, changed, or outdated params. (#5597) * Improving `economy.cpi` for the FRED data (#5602) * remove multiindex using coding magic * Update field descriptions --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Improve error message. * Improve * Test tests (#5607) * Test tests * Add test * 4.0.0a4 PyPI publishing (#5608) * changes to publish * fix mini conflict * typo * cleaned `descriptions.py` * fix description in `cpi.py` * Add ETF extension to v4 (#5609) * Add etf extension with search data model * Add FMP ETF search * Add fetcher tests * Add ETF historical price from yfinance (#5610) * Add etf extension with search data model * Add FMP ETF search * Add fetcher tests * Add etf historical price standard model and route * Add etf historical data from yfinance * Add unit tests * Fix linter error. Organize imports * Update test data * Revert common descriptions erased by CPI PR * remove `symbol` from data for `stocks.ca.peers` * Test docstrings (#5613) * Test docstrings * fix minor bugs w/@IgorWounds * static only w/@IgorWounds * fix `importance` param in `economy.econcal` * right static only w/@IgorWounds * Fix econcal and add tests to noxfile * fix econcal static * re-record --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Clean up the newly created ETF extension (#5611) * Add ETF to dev_install bundle * Add integration tests for openbb-etf * Patch integration test generator scripts to produce lintable code * Add py.typed markers for extensions * user preferences descriptions (#5593) * user preferences descriptions * typo * Feature/v4-sec-provider: Add SEC provider to V4 (#5556) * coerce string type, add default=None * add sec provider and FTD function * update description * ruff * data model definitions in standard model already * duplicate oecd entries in dev_install and pyproject * actually commit * integration test * add stock search to SEC * add company filings for SEC provider * integration tests * remove duplicated line * ruff * **kwargs in Transform Data * some helper functions for later * black * add helper for mutual fund and etf lookup * add some SEC lookup helpers to a new regulators extension * black * ruff * fix test param * take institution filter out of sec stock_search * ruff * remove URL that codespell doesn't like * add cik-to-ticker map * add litigations rss feed * make openbb-regulators a dependency of openbb-sec * add SIC search * improve ftd and remove BeautifulSoup from SEC dependencies * fix parsing the zip files pre-2009 * ruff * update descriptions * recapture ftd test * tests params * typo * change limit param to 1 in test_sec_stock_ftd * Add didiers to_records method (#5588) * Add didiers to_records * unused import * Bring back polars + do what igor suggested * Make the output consistent with what it was. * Black ? * spelling. oops. almost like we have a pre commit or something * Feature/v4-price-performance: % returns for various horizons, comparable across multiple tickers. (#5618) * coerce string type, add default=None * add price_performance endpoint from FMP * black * extra period in docstring * ruff * forgot one file * Feature/ipo-calendar: V4 IPO Calendar (#5605) * coerce string type, add default=None * add intrinio ipo calendar * fix typo * sort __init__ * fix description * make requested changes * update test params * black * test updates * etf integration * Add disc router and WSJ provider * OBBject extensions (#5612) * changes to core * bug? * docstring * doc * Update credentials.py * fix model_dump * create extensions * fix docstring * doc * revert change query_exc * doc * fix container test * redirect obbject test patch * doc * rename method * move decorator to extension file * rename method extend_obbject * changes in creds model * avoid credential racing * doc * rename prop * doc * doc * remove comment * comment some code * free extension names * docstring * doc * docs * Hotfix/fix-v4-economic-calendar: Add FMP to Econ Calendar and fix some TE bugs (#5580) * coerce string type, add default=None * adds fmp to economic calendar and fixes some things with TE * ruff * etf integration test * missing provider for test * rename te cassette to economic_calendar * fix test * rename tests --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Add stocks disc endpoints (#5630) * Add stocks disc endpoints * Explicit * Lint * Add tests * Bump timeout * Feature/disc router (#5616) * Add disc router and WSJ provider * Lint * Lint * Move endpoints under ETF router * Update etf_performance.py * Add ETF info and sector exposure from FMP (#5620) * Add ETF info from FMP * Add integration tests * Add unit tests * Add etf sectors endpoint * Add etf sectors fmp endpoint * Omit nested sector list from fmp info data * Update tests and test data * Update test data * Specify provider explicitly in integration tests * Update tests * Skip yfinance etf historical test * Fix linter errors after the merge * Fix more linter errors * Fix failing and add missing tests * Fix integration tests * Fix calendar ipo tests * Add ETF holdings and holding report dates from FMP (#5629) * Add ETF info from FMP * Add integration tests * Add unit tests * Add etf sectors endpoint * Add etf sectors fmp endpoint * Omit nested sector list from fmp info data * Update tests and test data * Update test data * Specify provider explicitly in integration tests * Update tests * Skip yfinance etf historical test * Add etf holdings and holdings date routes and standard models * Add fmp holdings and holding dates fetchers * Update holdings fetcher to properly handle date object inputs * Add unit tests * Add integration tests * Black after merge * Fix test input data format * Disc router for equities. (#5640) * Disc router for equities. * add tests * Bug fixes in financial statements (#5537) * `validator` to `field_validator` in standard models * Polygon add `ttm` to `period` param * Revert "Polygon add `ttm` to `period` param" * Polygon add `ttm` to param `period` * `EarningsCallTranscript` standard model removed `quarter` param * use `tag` instead of `name` for correct field name * fix url for intrinio income statement * modified intrinio cash flow `transform_data` function * set optional data fields and validate dates * fix insider trading not fetching recent data * linting * refactoring * refactoring * set param alias in fmp stock insider provider model * get all quarter data for intrinio * add `limit` param to `stocks.fa.ins` * refactoring and linting * removed additional comment * linting * re-recorded and fix tests * cash flow standard model field type to `StrictFloat` * Intrinio cash flow model fixed to get all quarters' data * linting * refactoring * financial statement standard model field type to `StrictFloat` * Intrinio financial statement model get all quarter data * set `period` type to `Optional[str]` * add `period` param to balance sheet provider models * add `period` param to cash flow provider models * use alias in model dump * remove `ttm` from `period` param * revamped intrinio financials * fixed incorrect description for `limit` param * modified tests for `balance`, `cash` and `income` * re-recorded tests * skipped intrinio financial statement fetcher tests * Add ETF county weighting command with FMP data (#5645) * Remove code that wrongfully infers the filing date as end of quarter * Add etf countries command with fmp data * Add countries command to etf router * Update sector and country weighting fmp models * Fix docstring typo * Add unit tests and update mock data * Add integration tests for etf.countries * Bring back missing integration tests * Fix economic calendar integration tests * fix missing data in intrinio financials * removed inutile params from Polygon financial statement models * Intrinio IPO overhaul * tests fixed and re-recorded * Add ETF holdings performance with FMP data (#5659) * Add etf holdings performance endpoint * Add tests * Fix failing polygon fetcher tests * Split long holdings lists into chunks and update test data * Change chunk length to 500 tickers * Add stock search from FMP (#5642) Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Feature/v4 pypi (#5579) * improvements to the publish script * move scripts * initial script that builds the package * adjustments on the docs * test pypi workflow * add hour and minute to version * black * ruff * duplicate file * moving files instead * build throught the script instead * update nox file * integration tests workflow * change workflow * fix dev_install * fix in sed cmd * testing the platform only * commenting out the publishing * fix run commands * improvements to the publish script and doc * fix publish script * updating the script and the workflow * feature/v4-pypi nightly (#5589) * init * Update nightly.py * cleanup * init file * not referencing dev_utils * updating obb platform key * revert * Increase warmup time * project name on pyproject and adding the --pre flag on readme * moving to the build folder * fix noxfile * reflecting the moves on the import statements * fix pyproject path * ruff * fix paths * fix super typo * update workflows * moving the pypi terminal files into its folder --------- Co-authored-by: teh_coderer <me@tehcoderer.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * economy.calendar nasdaq (#5628) * add quandl econcal * unittest * add integration tests * replace   * fix bug TE importance * small fix * remove stuff from quandl * add nasdaq provider * add nasdaq to install files * Update test_economy_api.py * test * quandl leftovers * remove quandl econcal test * lint * replace   * ruff * lint * update nasdaq gmt * validate countries * here * no need for this * fix calendar tests * static * static * remove error * static * readme + website * readme * remove changes TE * typo * fix unittest * fix tests * Update __init__.py * Update economic_calendar.py * revamped model and added helpers for date range --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Feature/v4-dividend-calendar: Adds Nasdaq dividend calendar and moves the command out of fundamental_analysis (#5672) * add nasdaq dividend calendar and move out of fundamental_analysis * black * ruff * add random-user-agent to pyproject.toml * add nasdaq ipo calendar * add nasdaq flag for SPO to IPO calendar * add spo test param * black * dividend test * fix transform_query - nasdaq_calendar_ipo * bring back different headers for ipo calendar * remove references to test * Add disc endpoints (#5660) * Add Quandl top retail * Add tests * Add Seeking Alpha * Add Filings * Change Provider * Fix test * Add dev_install * static * static correct * y u forget me * updated deps * static --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * using dev install (#5673) * Expanding the `fixedincome` menu (#5655) * models and fetcher * making the fetcher visible * std model * adding the command * improvements to the models * typo * adding the command * imrpovements to dwpcr * standard model for ecb int rates * adding the fetcher for fred * standard model of ice bofa * add ice_bofa command * ruff * ice bofa fetcher * moody std model * moody * std model * add cp command * unused import * cp * spot * ruff * hqm * tmc * ffrmc * tbffr * ruff * typing fixes * buggy dates * fred fetcher tests * ruff * adding ecb as a provider * adding new provider related stuff * adding the new command eu_ycvr * models * test for ecb fetcher * Feature/v4 fixedincome int tests (#5661) * integration tests * happy ruff * mini adjustment * ruff * typo * verbose type * fix tests * docstrings everywhere and an happy pydocstyle * fix tests * Feature/user-cache-dir: Add User Preference for the Cache Directory (#5621) * add user preference for storing cached data * ruff * fix tests? * fix test key error..? * etf integration test fix * add cache dir to SEC * black * improve docs structure for V4 (#5586) * improve docs structure for V4 * moving over changes * Add Docs to the navbar * add some, re-order sidebar * fix sentence * add docs install to source instructions * insert a couple of links, fix a typo * big terminal docs usage revamps * improve toggle component for tutorials * get rid of TOCs for all terminal docs for consistency and simplicity * improve platform docs * improve bot docs content structure * remove index from bot docs * improve ON THIS PAGE to only display TOC if at least 1 element * make edit this page text and icon on same line * add author and date to docs * add basic syntax page to usage * sidebar order for usage section * move api start command to the top with the import python import * some install page additions * small improvement * refactor routines section * Update introduction-to-routines.md * Update pipeline-of-commands.md * Update introduction-to-routines.md * Update routines-for-power-users.md * Update community-routines.md * update keyboard hotkey macros * askobb page * Update askobb-feature.md * Update index.md * Update index.md * Update index.md * Update index.md * fix images * remove HeadTitle from all files where it exist * get rid of extra spacing in markdown * small update * small edit * need index at the start because of main path when homepage of docs * use openAI to create SEO for front matter on my behalf * remove table of content from sdk page * finish improving metadata SEO for SDK docs * update duplicate header * update HeadTitle to be more specific on product * remove index from bot telegram reference * delete duplicated title for platform reference * another update * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * start PR so screenshots can get attached via GitHub website * Update qa.md * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * Update crypto introduction.md * titles * another title * Update crypto dd.md * Update defi.md * Update disc.md * Update nft.md * Update onchain.md * Update ov.md * Update introduction.md updates URL * Update introduction.md add HeadTitle * Update ba.md * Update comparison.md * Update dark-pool-shorts.md * Update disc.md * fix docs (#5646) * Update fa.md * Update gov.md * Update ins.md * Update tradinghours.md * Delete website/content/terminal/menus/stocks/options/screener.md * Update Options introduction.md * Update screener head title * Update screener TOC * Update econometrics.md * Update economy head title * Update etf.md * codespell * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Contributing guidelines (#5615) * intro section * what's expected sections * improve sections * improve sections and move how to add a data point * moving qa under contributor * better intro * moving the sharing section * better expectations * small intro to the contributor guidelines * moving things under the contributor section * there is no pre commits on the platform yet * dependency management * best practices for extensions * typo * collapse options subfolder * codespell * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update fixedincome.md * url * Update forecast.md * Update settings.md (#5665) * Update forex.md * fix front matter (#5667) * Fix conflict markers that got into markdown during previous merges * Fix front matter list formatting * Fix typo * small thing * fix hyperlinks * Update .codespell.ignore * output_type options * Architectural considerations * Update sidebar to hide pro section by default * Minor copy changes * TET pattern * import statements * clarification on preferences * Minor copy changes * Lint markdown and python * fix: open index on collapsible root elements * remove old content * options title * Fix linting errors * Refactor sidebar label to url mapping condition --------- Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Add multi-ticker support to etf_countries (#5670) * add multi-ticker support to etf_countries * remove commented-out lines * normalized percent points * percent -> percentage * Fix Nasdaq Econ Calendar Fetcher (#5668) * fix nasdaq econ cal request * more html tags * add random-user-agent to pyproject * another edge case - 24H -> 00:00 * Feature/v4-unusual-options: Adds unusual options endpoint. (#5677) * add unusual options fro Intrinio * test params * move sorting * Change type * update FMP fetcher to use the V4 endpoint (#5681) * Fix price performance not parsed correctly when there is only 1 ticker (#5678) * Add crypto search standard model and FMP data for it (#5679) * Apply renaming to news data (#5684) * inegration complete * reformatted for black * fix ruff issues * revised integration * changes to versions in pyproject.toml and updated lock files * Rename models * Update tests * Fix typos here and there * Update routers * Apply rename to ultima * Properly mock api key * Mock ultima api key --------- Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> * Feature/v4-market-snapshots: Adds full market snapshots (#5473) * add stocks market snapshots from fmp * add fmp fetcher test * unused imports * add polygon to market_snapshots * update fmp market_snapshots * black * pydantic2 things * updates * change validate_obj to model_validate * polygon cleanup * tests * descriptions * black * data description * minor adjustments, using less local variables, improving readability and removing pandas * better structure * minor adjustments * lint * fix int tests --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Add NBBO Quotes, with historical, to `obb.stocks.quote()` (#5617) * coerce string type, add default=None * add polygon stock quote * limit cleanup * add greater/less than to params * limit param * black * tests * fix tests * test_etf * rename model and function to NBBO * add standard model for nbbo * improve standardization * not redifining builtin max * fix input params * integration test params * removing unused import Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * revamped code * re-recorded nbbo test * added symbol validator * added alias in field * Stock news -> Company news --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * hotfix/update-quandl-to-nasdaq: Merge Quandl + Nasdaq (#5682) * merge quandl nd nasdaq * dev_install.py * test param name * economy python integration test * Add more input types to data processing commands (#5453) * adding more supported types to data processing commands * ruff * removing unused import * docstrings * data processing types covertion * data description * test filters * ruff * fix package builder tests * ruff * removing print * Add stocks/dps module (#5638) * short volume * pyproject missed * add sec short interest with days to cover * Add FINRA OTC endopoint * some tests * rest of unit tests * Integratin test scripts * dev install * linters caught by pre commit * lines too long * Last test files * maybe it needs a lock file? * thanks pratty * Maybe ill actually listen to pratty next time * sec test date freeze * I cant hit buttons * re record tests * tests 3 * Stockgrid test * regen int test * more testing * lint * moved these fns * dis killing me * one more test * last one * Update integration tests * Fix tests picking up wrong dps route --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Rename Forex to Currency (#5687) * restore fields as optional (#5686) * Rename Crypto (#5689) * added `crypto.price.historical` * static * fix tests * fix incorrect label * Move model from sec to finra (#5692) * Update toml * fixed deps * add openbb-etf lock file * cleanup * cleanup (#5694) * Rename Fixed Income (#5695) * Rename Fixed Income * Add routers * Rename stocks to equity (#5688) * Rename stocks folder * Rename openbb_stocks package * Rename routers * Reroute equity menu * Update routes based on feedback * StockNews -> EquityNews * StockInfo -> EquityProfile * Rename Equity calendars * Equity peers rename * Rename discovery * Rename fundamental * Rename price command models * Rename shorts * Update charting router * Fix seeking alpha upcoming release date * Fix linting errors * Update tests * Fix tests * Skip econometrics api tests because it's python only * Update integration tests and test data * Historical analyst estimates * Skip cboe options chain test. Unable to record vcr cassette * re-record cboe cassettes * Document CBOE unit test creation caveats --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Feature/files-for-igor: Adding a few standard models for Igor (#5699) * add some standard models for Igor * codespell * update descriptions * Add devtools metapackage (#5703) * Add openbb-devtools metapackage * adding devtools to the dev_install script --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Rename econometrics commands to be more verbose (#5702) * Expose command to model map (#5706) * Rename ta qa (#5708) * Rename ta folder * Rename ta to technical * Rename qa folder * Rename qa to quantitative * Rename the actual routes in quantitative * Equity cleanup (#5707) * cleanup * static * renaming to equity cc @the-praxs * Proof reading --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Don't enforce imperative for first word of the docstring * Remove ultima from default extensions * Rename `economy` and create `index` extension (#5705) * renamed economy and re-recorded tests * static * market indices * european indices * fred indices * index constituents * tests * correct package name * oops * static * linting * Move COT commands to regulators * Rename economy.list to available_indices * Rename GDP models and clean up * Fix charting tests * Drop _indices from available_indices command * Fix obbject to_dict test --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Rename etf/disc (#5715) * Docs/v4-working-docs: PR to Work on V4 Docs (#5693) * Revert changes related to pydantic2 made into v3 code * Revert fred model changes in v3 * Revert pydantic2 databento model changes in v2 * Update some names and v3 lock file * Clean up openbb/package before the beta release * Platform publishing procedure (#5701) * update instructions * introducing the version script * publish message * fix platform path * reflecting version changes * getting version from installed packages instead * removing toml from dependencies * Changes to get `a7` out (#5697) * changes to get a7 out * etf menu on the pyproject.toml * poetry lock * bump `openbb-etf` to `a5` to match version * updated deps * removing ultima * removing references to a4 cc @the-praxs * Bump index menu version * poetry lock --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Update publishing instructions * Bump core dependencies in extensions and providers * Add changes to the publish script following the beta release * Update the versions in static extension map and openbb metapackage --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply… * Release/4.2.1 (#6456) * tmx etf info (#6132) Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> * [Feature] - Platform V4 Markdown Generator V2 (#6094) * add recent `openapi.json` * fix data types in models * removed `openapi.json` * set default date value as None in PolygonCurrencyPairs class * add function to generate reference.json file * reworked function to improve readability * reword function to add seo metadata * add functions for creating markdown sections * add code to extract data card markdown title * add additional functions for generating index and data models file * extract first sentence of the description for cards * code cleanup and documentation * linting * linting polygon models * add openbb import statement in create_reference_markdown_examples function * add POST method functions * cleanup; reworked generate_reference_index_files function * moved development section to 7th position in the sidebar * fix POST function params default value add standard flag to QueryParams and Data fields cleanup * add type expansion from package_builder.MethodDefinition * sort data models cards alphabetically make printing less verbose * make MAX_CARDS global display less content in cards in Commannds section * cleanup * Remove '_' from the cards under Commands section * " to ' in econometrics/causality * replace ' with " in ReferenceCard for reference dir index files * remove extra . from the quantile function description * shoutout to @deeleeramone for finding POST method description bug! * set correct value for standard field * handle BaseModel types in provider data fields * unit tests for the platform markdown generator v2 * yeet 'Default' and 'Optional' columns in the 'Data' section * last minute bug fix * add info for multiple symbols * make multiple items info same as platform static * organize sections properly * sort reference sub-directories alphabetically * extra space in 'OBBject extra' description * add type expansion for fields with multiple items POST method cleanup --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * [Docs] Adds Example Notebook for the Implied Earnings Move (#6128) * adds example notebook for the implied earnings move * remove commented out line --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * [Feature] - Sync with new openapi.json (#6137) * feat: create data tabs * fix: uncomment * fix: remove unecessary comment * sort side bar * comment * uncomment * use .dev functions.json + clean traverse * fix futures example * fix example * point to .co * Fix the v3 markdown generation workflow (#6138) * fix workflow * debug time * see if the docs generate at least * ahhhh i found it * getting there * put the test first * some keys cleanup * small change to error message * update functions.json (#6140) * fix intraday check in charting ta_class (#6119) Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> * [BugFix] Display EconDB as source for macro (#6143) * [BugFix] Disable Intrinio `InstitutionalOwnership` model (#6142) * disable fetcher in init and fetcher tests * disable provider test params from equity python and api tests * updated static * add more examples into findSymbols (#6139) Co-authored-by: James Maslek <jmaslek11@gmail.com> * [BugFix] Fix SEC ETF Holdings Parsing Exception (#6121) * fix etf holdings * linting * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Docs/update xl docs (#6145) * remove print * update obb.get docs * example * md lint * fix get reference (#6147) * [BugFix] Filter OECD data using `start_date` and `end_date` parameters (#6144) * move constant dicts to constants.py filter by start_date and end_date * black * black again again * Merge 'main' into 'develop' (#6151) * Release/3.2.4 (#5696) * test * ultima description (#5541) * Updating showcase page (#5543) * updating showcase page * use sdk instead * add new bot command autopost docs (#5530) add new bot command autopost docs to docs.openbb.co Co-authored-by: James Maslek <jmaslek11@gmail.com> * Hotfix/ultima improvements (#5553) * tweaks for monetization * fix linting issue * fix: Modify 'load' behavior to append data to existing sheet (#5503) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Fixed 'worksheet not found' error during export to an existing sheet * Changes: * Now if the sheet exists in the xlsx file it will ask the user if he wants to replace/append/create new sheet --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * added platform API integration test to Nightly build (#5571) * Add columns to `stocks/search` (#5565) * Add columns to `stocks/search` isin, cusip, figi, composite_figi, shareclass_figi * Update test_search[False].txt * Update test_search[True].txt * Delete tests/openbb_terminal/stocks/cassettes/test_stocks_helper/test_search.yaml * Create test_search.yaml --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * updating ultima urls (#5587) * fix: A value is trying to be set on a copy of a slice from a DataFrame #5582 (#5591) * Update README.md (#5598) * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * fix docs (#5646) * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update settings.md (#5665) * fix front matter (#5667) * #5633 adding comma every 1000 (#5652) * #5633 adding comma every 1000 * pylint --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Hotfix/reports model render report sanitize inputs (#5669) * Adding more robust special character handling to create_output_path().Addresses https://github.com/OpenBB-finance/OpenBBTerminal/issues/5299 * Running black linter on code to conform to OBB style guides. --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * hotfix/fix-gov-histcont: Fix #5650 - /stocks/gov/histcont (#5676) * fix histcont * some cleanup * remove sort line * 12-31 not 12-12 * columns_keep_types * remove space in regex (#5675) * Pin openai (#5685) * Clarified stocks/ta empty recom object message (#5468) * Clarified stocks/ta empty recom object message * black * lint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * improved market cap value extraction (#5169) * improved market cap value extraction * pylint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * 3.2.3->3.2.4 * Changelogs * new changelog --------- Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Andrew <andrew.kenreich@gmail.com> Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Luqman <luqazino@gmail.com> Co-authored-by: Adwait <111136306+AdwaitSalankar@users.noreply.github.com> Co-authored-by: Abhishek Amar <66067391+abhishek-amar@users.noreply.github.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Ramazan <guvencramazan@outlook.com> Co-authored-by: joshuabuildsthings <joshuabuildsthings@users.noreply.github.com> Co-authored-by: wojda <114031148+polooner@users.noreply.github.com> Co-authored-by: Bim Phomthong <118195204+bimbolimbo@users.noreply.github.com> * Release/4.0.1 (#5840) * test * ultima description (#5541) * Updating showcase page (#5543) * updating showcase page * use sdk instead * add new bot command autopost docs (#5530) add new bot command autopost docs to docs.openbb.co Co-authored-by: James Maslek <jmaslek11@gmail.com> * Hotfix/ultima improvements (#5553) * tweaks for monetization * fix linting issue * fix: Modify 'load' behavior to append data to existing sheet (#5503) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Fixed 'worksheet not found' error during export to an existing sheet * Changes: * Now if the sheet exists in the xlsx file it will ask the user if he wants to replace/append/create new sheet --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * added platform API integration test to Nightly build (#5571) * Add columns to `stocks/search` (#5565) * Add columns to `stocks/search` isin, cusip, figi, composite_figi, shareclass_figi * Update test_search[False].txt * Update test_search[True].txt * Delete tests/openbb_terminal/stocks/cassettes/test_stocks_helper/test_search.yaml * Create test_search.yaml --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * updating ultima urls (#5587) * fix: A value is trying to be set on a copy of a slice from a DataFrame #5582 (#5591) * Update README.md (#5598) * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * fix docs (#5646) * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update settings.md (#5665) * fix front matter (#5667) * #5633 adding comma every 1000 (#5652) * #5633 adding comma every 1000 * pylint --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Hotfix/reports model render report sanitize inputs (#5669) * Adding more robust special character handling to create_output_path().Addresses https://github.com/OpenBB-finance/OpenBBTerminal/issues/5299 * Running black linter on code to conform to OBB style guides. --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * hotfix/fix-gov-histcont: Fix #5650 - /stocks/gov/histcont (#5676) * fix histcont * some cleanup * remove sort line * 12-31 not 12-12 * columns_keep_types * remove space in regex (#5675) * Pin openai (#5685) * Clarified stocks/ta empty recom object message (#5468) * Clarified stocks/ta empty recom object message * black * lint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * improved market cap value extraction (#5169) * improved market cap value extraction * pylint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Release/3.2.4 (#5704) * 3.2.3->3.2.4 * Changelogs * new changelog * OpenBB Platform v4 (#5225) * change location * check something * add cache * fixed auth w/@IgorWounds and @montezdesousa * fixes for econometrics * include Darren auth suggestions * some routers included if dev + chg hub backend var * coverage router should not be here * update docker readme * forgot to check auth here * Change extension imports * update docstrings and readme * headers function wasnt being called, just referenced * relative import * econometrics add headers everywhere * Fix QA * Fix TA * Fix test * Fix python interface QA and TA * Lint * Cleanup * Change path * make the changes and some etf models * tests for command_runner * ruff * solving naming issues on pytest * Update some docstrings, fix typos and lint * solving econometrics instantiating wrong openbb * chaging the way pytest runs * messing around with the imports * ruff * Change template to add platform considerations (#5533) * change template to add platform considerations * @the-praxs suggestions * solving __pycache__ issue * removing typo * ci yml * making linters happy (i guess) * Improve Omega Ratio and docstrings * chaging pro validation hash * ruff * Fix OLS Summary and lint * Add OECD Provider for economy extension (#5534) * Add record to docs * update a couple of cboe models * Fix econometrics bugs. Make tests pass. Lint. * black * ruff * pydantic v2: remove deprecated Extra * pydantic v2: self.dict -> self.model_dump * revert pydantic * revert the revert * try 1: pin urllib3 < 2 * Revert "try 1: pin urllib3 < 2" This reverts commit3736c311cb. * Revert dep * Fix * re-lock * Skip all tests when doing cspell in pre-commit * Resolve linter errors * Add OECD to install script * Add OECD * Resolve more linter errors * Exclude static files of v4 python from ruff * More linting * Another attempt to resolve even more linting errors * Change how Literal is used * ticker. symbol. consistent. @piiq * change ticker field in Stock Search to is_symbol * Update Cboe model for stocks_search -> is_symbol parameter. * Fix issue * Lint * Small QA to rename SDK to Platform (#5544) * SDK -> Platform in docs * renamed in core * renamed in openbb `init` * `sdk` variable renamed as `platform` --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * `validator` -> `field_validator` in standard models * Standard convention for multi-ticker symbols (#5549) * standardize symbol input param in forex and crypto historical data * static * linting * Fix stock_search integration test params * Update dependencies and linting on the CI (#5550) * Remove ruff and black from platform dependencies * Update codespell configuration * Lint python code * Add toml and tomli to root dev dependencies * Update requirements.txt files * Fix buggy docstring in python package methods (#5548) * fix buggy docstring for methods * remove space * fix typing * avoid name collision with validator * Revert "avoid name collision with validator" This reverts commit8a30a44555. * typing * rebuild * python 3.8, ParamSpec not available * lint * ruff noqa * Merge with develop (#5551) * Charting extension integration tests (#5547) * initial proposal for integration tests on the charting extension * int tests for charting generation * python generator * ruff * boilerplate templates * python tests * tests for the api * using body instead so data don't get redefined * unit tests for coverage * ruff * docstrings * unnecessary access to keys() * Add trading economics economic calendar * dev install * Data Models disposition on the website (#5538) * pydantic v4 * flat structure * md files * Revert "md files" This reverts commitbd2170e2ad. * improve command descriptions * nice title and description * human readble data model names on left panel * implementation details section * content markdown files * markdown versioned files * showcase page * updates --------- Co-authored-by: tehcoderer <me@tehcoderer.com> * everything except tests * fix `datetime.date` import in fetcher test * modified url to remove `api_key` placeholder * record test * api key is called c here * fixed fetcher test for api key * recorded tests * refactor * life is ruff * codespell * Make Intrinio options chains great again (#5540) * add multithreading * cleanup * linting * use dateutil.parser * removed `TICKER_EXCEPTIONS` * modified `date` and `type` fields in standard model * set alias for `date` and `type` to match standards * static * static * Hotfix/fix post tests (#5555) * Fix econometrics * Fix ta * Fix qa. Remove intrinio to not be rate limited * Lint * Fix typo * obbject tests (#5558) * obbject tests * ruff * fix dev_install * fix unittests * black on nox * black on nox * nox * fix fetcher test so it can compare dates * fix intrinio tests * ruff * change to model_dum() instead (#5561) * Passing tests (#5560) * Passing tests * fix options * Fix most tests and bugs * fix forex missing params * make symbol upper in polygon fx pairs * fix fixedincome integration tests (#5564) * Fixing charting api integration tests (#5562) * fixing charting api integration tests * black * fix stocks less five API fails * fix the 5 failing stocks integration tests * recapture fmp stock news unit test * fix fmp forex api test * couple more forex integration fixes * changing the request to always use the legacy session. @jmaslek this is was broken for 3.8 and 3.9; with this change apparently all versions work - lemme know if you see any issue with this change * ruff * fix ta * add missing param * fix testers for the api * fix globalnews to use images instead of image * remove unncessary pandas import * econcal int tests * update gitignore * fix get_querystring to support lists * add missing parameters --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> * Stock Historical standardization and UX improvements (#5457) * polygon add interval standard param * attempt at standardization * Alpha Vantage params standardization * rename `get_intervals` and fixed bug for extracting wrong value * missed changing it in `extract_data` * linting * polygon cleanup * modified `start_date` & `end_date` type to `datetime` from `dateType` * standardized intrinio stock historical params * fixed yfinance * linting * revert start and end date to dateType from datetime * fix alpha vantage * changed param * fix intrinio infinite loop * `validator` is `field_validator` * revert time params and fixed intervals * `outputsize` alias set in `Field` * set interval description using in-build dict * yfinance stock param standardization * static * intrinio cleanup * Polygon add api params as `PrivateAttr` * modified yfinance params to `PrivateAttr` * intrinio remove overriding date params * fixed description for AV adjusted param * fix alpha vantage intraday not working * re-record and pass unit tests * pass integration tests * Update test --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * Fix econcal endpoint (#5567) * fix econcal for python interface * fix econcal tests * fix non supported json output * Fixes FMP index endpoint to get 1 day interval data (#5535) * fix FMP endpoint for getting index data for `1day` interval * fix `open` type to prevent validation error * modifed `validator` to `field_validator` * type of fields is `StrictFloat` * re-record and pass test * linting * `validator` -> `field_validator`, a3'd everything * Fix regression in tests. Lint * updating the integration test actions * Fix typo * Fix typo * Fix import * Publish versions `a3` to Pypi (#5568) * bump versions and script to publish * small improvements * uncomment exception * openbb * publishing guidelines * improve docs * add providers to economy api * make symbol required in stock_quote * Fix keys * Fix oecd * add comma * revert * Add quotes * Sleep * Improve tests * Improve * Feature/query transform (#5566) * inject query into transform_data * swap query and data * update missing fetchers * last test failing * sig test fetcher * black * av add `query` to `transform_data` call * transform_data: missing refactoring * fix uvicorn command in the doc * Automated examples (#5576) * Automated examples * Fix bug * Lint * static assets built on 3.8 * Revert "static assets built on 3.8" This reverts commitfb82ff7bd9. * remove assets * static assets on 3.8 * static assets on 3.8 * Wrap in quotes * Improve wrap * minor fix * rebuild 3.8 * Fix bug * Fix edge case * Lint * rebuild --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> * use SecretStr for sensitive fields (#5578) * use SecretStr for sensitive fields * fix * docstring * Add tests for provider (#5583) * Add tests for provider * Test standard models * Lint * Fix standard model issues. Co-authored-by: @the-praxs * linting * `symbol` -> `is_symbol` in `economy.index_search` * static --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * feature/v4-biztoc-provider: Adds Biztoc provider and GlobalNews (#5546) * add biztoc provider * duplicate field * black * request headers * recapture test * move stuff around * add integration tests * duplicate OECD entry in dev_install * duplicate entry for oecd in pyproject.toml * Add Biztoc to workflow * update readme: credentials * Add Preferences to README * improve tests * fix biztoc * obbject pylint * Bug fix: serializ SecretStr before dumping to json * export credentials as json (#5592) * Check for wrong, changed, or outdated params. (#5597) * Improving `economy.cpi` for the FRED data (#5602) * remove multiindex using coding magic * Update field descriptions --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Improve error message. * Improve * Test tests (#5607) * Test tests * Add test * 4.0.0a4 PyPI publishing (#5608) * changes to publish * fix mini conflict * typo * cleaned `descriptions.py` * fix description in `cpi.py` * Add ETF extension to v4 (#5609) * Add etf extension with search data model * Add FMP ETF search * Add fetcher tests * Add ETF historical price from yfinance (#5610) * Add etf extension with search data model * Add FMP ETF search * Add fetcher tests * Add etf historical price standard model and route * Add etf historical data from yfinance * Add unit tests * Fix linter error. Organize imports * Update test data * Revert common descriptions erased by CPI PR * remove `symbol` from data for `stocks.ca.peers` * Test docstrings (#5613) * Test docstrings * fix minor bugs w/@IgorWounds * static only w/@IgorWounds * fix `importance` param in `economy.econcal` * right static only w/@IgorWounds * Fix econcal and add tests to noxfile * fix econcal static * re-record --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Clean up the newly created ETF extension (#5611) * Add ETF to dev_install bundle * Add integration tests for openbb-etf * Patch integration test generator scripts to produce lintable code * Add py.typed markers for extensions * user preferences descriptions (#5593) * user preferences descriptions * typo * Feature/v4-sec-provider: Add SEC provider to V4 (#5556) * coerce string type, add default=None * add sec provider and FTD function * update description * ruff * data model definitions in standard model already * duplicate oecd entries in dev_install and pyproject * actually commit * integration test * add stock search to SEC * add company filings for SEC provider * integration tests * remove duplicated line * ruff * **kwargs in Transform Data * some helper functions for later * black * add helper for mutual fund and etf lookup * add some SEC lookup helpers to a new regulators extension * black * ruff * fix test param * take institution filter out of sec stock_search * ruff * remove URL that codespell doesn't like * add cik-to-ticker map * add litigations rss feed * make openbb-regulators a dependency of openbb-sec * add SIC search * improve ftd and remove BeautifulSoup from SEC dependencies * fix parsing the zip files pre-2009 * ruff * update descriptions * recapture ftd test * tests params * typo * change limit param to 1 in test_sec_stock_ftd * Add didiers to_records method (#5588) * Add didiers to_records * unused import * Bring back polars + do what igor suggested * Make the output consistent with what it was. * Black ? * spelling. oops. almost like we have a pre commit or something * Feature/v4-price-performance: % returns for various horizons, comparable across multiple tickers. (#5618) * coerce string type, add default=None * add price_performance endpoint from FMP * black * extra period in docstring * ruff * forgot one file * Feature/ipo-calendar: V4 IPO Calendar (#5605) * coerce string type, add default=None * add intrinio ipo calendar * fix typo * sort __init__ * fix description * make requested changes * update test params * black * test updates * etf integration * Add disc router and WSJ provider * OBBject extensions (#5612) * changes to core * bug? * docstring * doc * Update credentials.py * fix model_dump * create extensions * fix docstring * doc * revert change query_exc * doc * fix container test * redirect obbject test patch * doc * rename method * move decorator to extension file * rename method extend_obbject * changes in creds model * avoid credential racing * doc * rename prop * doc * doc * remove comment * comment some code * free extension names * docstring * doc * docs * Hotfix/fix-v4-economic-calendar: Add FMP to Econ Calendar and fix some TE bugs (#5580) * coerce string type, add default=None * adds fmp to economic calendar and fixes some things with TE * ruff * etf integration test * missing provider for test * rename te cassette to economic_calendar * fix test * rename tests --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Add stocks disc endpoints (#5630) * Add stocks disc endpoints * Explicit * Lint * Add tests * Bump timeout * Feature/disc router (#5616) * Add disc router and WSJ provider * Lint * Lint * Move endpoints under ETF router * Update etf_performance.py * Add ETF info and sector exposure from FMP (#5620) * Add ETF info from FMP * Add integration tests * Add unit tests * Add etf sectors endpoint * Add etf sectors fmp endpoint * Omit nested sector list from fmp info data * Update tests and test data * Update test data * Specify provider explicitly in integration tests * Update tests * Skip yfinance etf historical test * Fix linter errors after the merge * Fix more linter errors * Fix failing and add missing tests * Fix integration tests * Fix calendar ipo tests * Add ETF holdings and holding report dates from FMP (#5629) * Add ETF info from FMP * Add integration tests * Add unit tests * Add etf sectors endpoint * Add etf sectors fmp endpoint * Omit nested sector list from fmp info data * Update tests and test data * Update test data * Specify provider explicitly in integration tests * Update tests * Skip yfinance etf historical test * Add etf holdings and holdings date routes and standard models * Add fmp holdings and holding dates fetchers * Update holdings fetcher to properly handle date object inputs * Add unit tests * Add integration tests * Black after merge * Fix test input data format * Disc router for equities. (#5640) * Disc router for equities. * add tests * Bug fixes in financial statements (#5537) * `validator` to `field_validator` in standard models * Polygon add `ttm` to `period` param * Revert "Polygon add `ttm` to `period` param" * Polygon add `ttm` to param `period` * `EarningsCallTranscript` standard model removed `quarter` param * use `tag` instead of `name` for correct field name * fix url for intrinio income statement * modified intrinio cash flow `transform_data` function * set optional data fields and validate dates * fix insider trading not fetching recent data * linting * refactoring * refactoring * set param alias in fmp stock insider provider model * get all quarter data for intrinio * add `limit` param to `stocks.fa.ins` * refactoring and linting * removed additional comment * linting * re-recorded and fix tests * cash flow standard model field type to `StrictFloat` * Intrinio cash flow model fixed to get all quarters' data * linting * refactoring * financial statement standard model field type to `StrictFloat` * Intrinio financial statement model get all quarter data * set `period` type to `Optional[str]` * add `period` param to balance sheet provider models * add `period` param to cash flow provider models * use alias in model dump * remove `ttm` from `period` param * revamped intrinio financials * fixed incorrect description for `limit` param * modified tests for `balance`, `cash` and `income` * re-recorded tests * skipped intrinio financial statement fetcher tests * Add ETF county weighting command with FMP data (#5645) * Remove code that wrongfully infers the filing date as end of quarter * Add etf countries command with fmp data * Add countries command to etf router * Update sector and country weighting fmp models * Fix docstring typo * Add unit tests and update mock data * Add integration tests for etf.countries * Bring back missing integration tests * Fix economic calendar integration tests * fix missing data in intrinio financials * removed inutile params from Polygon financial statement models * Intrinio IPO overhaul * tests fixed and re-recorded * Add ETF holdings performance with FMP data (#5659) * Add etf holdings performance endpoint * Add tests * Fix failing polygon fetcher tests * Split long holdings lists into chunks and update test data * Change chunk length to 500 tickers * Add stock search from FMP (#5642) Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Feature/v4 pypi (#5579) * improvements to the publish script * move scripts * initial script that builds the package * adjustments on the docs * test pypi workflow * add hour and minute to version * black * ruff * duplicate file * moving files instead * build throught the script instead * update nox file * integration tests workflow * change workflow * fix dev_install * fix in sed cmd * testing the platform only * commenting out the publishing * fix run commands * improvements to the publish script and doc * fix publish script * updating the script and the workflow * feature/v4-pypi nightly (#5589) * init * Update nightly.py * cleanup * init file * not referencing dev_utils * updating obb platform key * revert * Increase warmup time * project name on pyproject and adding the --pre flag on readme * moving to the build folder * fix noxfile * reflecting the moves on the import statements * fix pyproject path * ruff * fix paths * fix super typo * update workflows * moving the pypi terminal files into its folder --------- Co-authored-by: teh_coderer <me@tehcoderer.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * economy.calendar nasdaq (#5628) * add quandl econcal * unittest * add integration tests * replace   * fix bug TE importance * small fix * remove stuff from quandl * add nasdaq provider * add nasdaq to install files * Update test_economy_api.py * test * quandl leftovers * remove quandl econcal test * lint * replace   * ruff * lint * update nasdaq gmt * validate countries * here * no need for this * fix calendar tests * static * static * remove error * static * readme + website * readme * remove changes TE * typo * fix unittest * fix tests * Update __init__.py * Update economic_calendar.py * revamped model and added helpers for date range --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Feature/v4-dividend-calendar: Adds Nasdaq dividend calendar and moves the command out of fundamental_analysis (#5672) * add nasdaq dividend calendar and move out of fundamental_analysis * black * ruff * add random-user-agent to pyproject.toml * add nasdaq ipo calendar * add nasdaq flag for SPO to IPO calendar * add spo test param * black * dividend test * fix transform_query - nasdaq_calendar_ipo * bring back different headers for ipo calendar * remove references to test * Add disc endpoints (#5660) * Add Quandl top retail * Add tests * Add Seeking Alpha * Add Filings * Change Provider * Fix test * Add dev_install * static * static correct * y u forget me * updated deps * static --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * using dev install (#5673) * Expanding the `fixedincome` menu (#5655) * models and fetcher * making the fetcher visible * std model * adding the command * improvements to the models * typo * adding the command * imrpovements to dwpcr * standard model for ecb int rates * adding the fetcher for fred * standard model of ice bofa * add ice_bofa command * ruff * ice bofa fetcher * moody std model * moody * std model * add cp command * unused import * cp * spot * ruff * hqm * tmc * ffrmc * tbffr * ruff * typing fixes * buggy dates * fred fetcher tests * ruff * adding ecb as a provider * adding new provider related stuff * adding the new command eu_ycvr * models * test for ecb fetcher * Feature/v4 fixedincome int tests (#5661) * integration tests * happy ruff * mini adjustment * ruff * typo * verbose type * fix tests * docstrings everywhere and an happy pydocstyle * fix tests * Feature/user-cache-dir: Add User Preference for the Cache Directory (#5621) * add user preference for storing cached data * ruff * fix tests? * fix test key error..? * etf integration test fix * add cache dir to SEC * black * improve docs structure for V4 (#5586) * improve docs structure for V4 * moving over changes * Add Docs to the navbar * add some, re-order sidebar * fix sentence * add docs install to source instructions * insert a couple of links, fix a typo * big terminal docs usage revamps * improve toggle component for tutorials * get rid of TOCs for all terminal docs for consistency and simplicity * improve platform docs * improve bot docs content structure * remove index from bot docs * improve ON THIS PAGE to only display TOC if at least 1 element * make edit this page text and icon on same line * add author and date to docs * add basic syntax page to usage * sidebar order for usage section * move api start command to the top with the import python import * some install page additions * small improvement * refactor routines section * Update introduction-to-routines.md * Update pipeline-of-commands.md * Update introduction-to-routines.md * Update routines-for-power-users.md * Update community-routines.md * update keyboard hotkey macros * askobb page * Update askobb-feature.md * Update index.md * Update index.md * Update index.md * Update index.md * fix images * remove HeadTitle from all files where it exist * get rid of extra spacing in markdown * small update * small edit * need index at the start because of main path when homepage of docs * use openAI to create SEO for front matter on my behalf * remove table of content from sdk page * finish improving metadata SEO for SDK docs * update duplicate header * update HeadTitle to be more specific on product * remove index from bot telegram reference * delete duplicated title for platform reference * another update * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * start PR so screenshots can get attached via GitHub website * Update qa.md * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * Update crypto introduction.md * titles * another title * Update crypto dd.md * Update defi.md * Update disc.md * Update nft.md * Update onchain.md * Update ov.md * Update introduction.md updates URL * Update introduction.md add HeadTitle * Update ba.md * Update comparison.md * Update dark-pool-shorts.md * Update disc.md * fix docs (#5646) * Update fa.md * Update gov.md * Update ins.md * Update tradinghours.md * Delete website/content/terminal/menus/stocks/options/screener.md * Update Options introduction.md * Update screener head title * Update screener TOC * Update econometrics.md * Update economy head title * Update etf.md * codespell * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Contributing guidelines (#5615) * intro section * what's expected sections * improve sections * improve sections and move how to add a data point * moving qa under contributor * better intro * moving the sharing section * better expectations * small intro to the contributor guidelines * moving things under the contributor section * there is no pre commits on the platform yet * dependency management * best practices for extensions * typo * collapse options subfolder * codespell * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update fixedincome.md * url * Update forecast.md * Update settings.md (#5665) * Update forex.md * fix front matter (#5667) * Fix conflict markers that got into markdown during previous merges * Fix front matter list formatting * Fix typo * small thing * fix hyperlinks * Update .codespell.ignore * output_type options * Architectural considerations * Update sidebar to hide pro section by default * Minor copy changes * TET pattern * import statements * clarification on preferences * Minor copy changes * Lint markdown and python * fix: open index on collapsible root elements * remove old content * options title * Fix linting errors * Refactor sidebar label to url mapping condition --------- Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Add multi-ticker support to etf_countries (#5670) * add multi-ticker support to etf_countries * remove commented-out lines * normalized percent points * percent -> percentage * Fix Nasdaq Econ Calendar Fetcher (#5668) * fix nasdaq econ cal request * more html tags * add random-user-agent to pyproject * another edge case - 24H -> 00:00 * Feature/v4-unusual-options: Adds unusual options endpoint. (#5677) * add unusual options fro Intrinio * test params * move sorting * Change type * update FMP fetcher to use the V4 endpoint (#5681) * Fix price performance not parsed correctly when there is only 1 ticker (#5678) * Add crypto search standard model and FMP data for it (#5679) * Apply renaming to news data (#5684) * inegration complete * reformatted for black * fix ruff issues * revised integration * changes to versions in pyproject.toml and updated lock files * Rename models * Update tests * Fix typos here and there * Update routers * Apply rename to ultima * Properly mock api key * Mock ultima api key --------- Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> * Feature/v4-market-snapshots: Adds full market snapshots (#5473) * add stocks market snapshots from fmp * add fmp fetcher test * unused imports * add polygon to market_snapshots * update fmp market_snapshots * black * pydantic2 things * updates * change validate_obj to model_validate * polygon cleanup * tests * descriptions * black * data description * minor adjustments, using less local variables, improving readability and removing pandas * better structure * minor adjustments * lint * fix int tests --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Add NBBO Quotes, with historical, to `obb.stocks.quote()` (#5617) * coerce string type, add default=None * add polygon stock quote * limit cleanup * add greater/less than to params * limit param * black * tests * fix tests * test_etf * rename model and function to NBBO * add standard model for nbbo * improve standardization * not redifining builtin max * fix input params * integration test params * removing unused import Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * revamped code * re-recorded nbbo test * added symbol validator * added alias in field * Stock news -> Company news --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * hotfix/update-quandl-to-nasdaq: Merge Quandl + Nasdaq (#5682) * merge quandl nd nasdaq * dev_install.py * test param name * economy python integration test * Add more input types to data processing commands (#5453) * adding more supported types to data processing commands * ruff * removing unused import * docstrings * data processing types covertion * data description * test filters * ruff * fix package builder tests * ruff * removing print * Add stocks/dps module (#5638) * short volume * pyproject missed * add sec short interest with days to cover * Add FINRA OTC endopoint * some tests * rest of unit tests * Integratin test scripts * dev install * linters caught by pre commit * lines too long * Last test files * maybe it needs a lock file? * thanks pratty * Maybe ill actually listen to pratty next time * sec test date freeze * I cant hit buttons * re record tests * tests 3 * Stockgrid test * regen int test * more testing * lint * moved these fns * dis killing me * one more test * last one * Update integration tests * Fix tests picking up wrong dps route --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Rename Forex to Currency (#5687) * restore fields as optional (#5686) * Rename Crypto (#5689) * added `crypto.price.historical` * static * fix tests * fix incorrect label * Move model from sec to finra (#5692) * Update toml * fixed deps * add openbb-etf lock file * cleanup * cleanup (#5694) * Rename Fixed Income (#5695) * Rename Fixed Income * Add routers * Rename stocks to equity (#5688) * Rename stocks folder * Rename openbb_stocks package * Rename routers * Reroute equity menu * Update routes based on feedback * StockNews -> EquityNews * StockInfo -> EquityProfile * Rename Equity calendars * Equity peers rename * Rename discovery * Rename fundamental * Rename price command models * Rename shorts * Update charting router * Fix seeking alpha upcoming release date * Fix linting errors * Update tests * Fix tests * Skip econometrics api tests because it's python only * Update integration tests and test data * Historical analyst estimates * Skip cboe options chain test. Unable to record vcr cassette * re-record cboe cassettes * Document CBOE unit test creation caveats --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Feature/files-for-igor: Adding a few standard models for Igor (#5699) * add some standard models for Igor * codespell * update descriptions * Add devtools metapackage (#5703) * Add openbb-devtools metapackage * adding devtools to the dev_install script --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Rename econometrics commands to be more verbose (#5702) * Expose command to model map (#5706) * Rename ta qa (#5708) * Rename ta folder * Rename ta to technical * Rename qa folder * Rename qa to quantitative * Rename the actual routes in quantitative * Equity cleanup (#5707) * cleanup * static * renaming to equity cc @the-praxs * Proof reading --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Don't enforce imperative for first word of the docstring * Remove ultima from default extensions * Rename `economy` and create `index` extension (#5705) * renamed economy and re-recorded tests * static * market indices * european indices * fred indices * index constituents * tests * correct package name * oops * static * linting * Move COT commands to regulators * Rename economy.list to available_indices * Rename GDP models and clean up * Fix charting tests * Drop _indices from available_indices command * Fix obbject to_dict test --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Rename etf/disc (#5715) * Docs/v4-working-docs: PR to Work on V4 Docs (#5693) * Revert changes related to pydantic2 made into v3 code * Revert fred model changes in v3 * Revert pydantic2 databento model changes in v2 * Update some names and v3 lock file * Clean up openbb/package before the beta release * Platform publishing procedure (#5701) * update instructions * introducing the version script * publish message * fix platform path * reflecting version changes * getting version from installed packages instead * removing toml from dependencies * Changes to get `a7` out (#5697) * changes to get a7 out * etf menu on the pyproject.toml * poetry lock * bump `openbb-etf` to `a5` to match version * updated deps * removing ultima * removing references to a4 cc @the-praxs * Bump index menu version * poetry lock --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Update publishing instructions * Bump core dependencies in extensions and providers * Add changes to the publish script following the beta release * Update the versions in static extension map and openbb metapackage --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: tehcoderer <me@tehcoderer.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> * Hotfix/pypi openbb terminal (#5719) * renaming the project * documentation changes * Finishing touches to the publishing procedure (#5728) * finishing touches to the publishing procedure * grammar improvements * Run tests on develop (#5725) * Run tests on develop * Add a check that files changes in platform * Seprate Intrinio financials data tags into a different command (#5723) * add `ebit` field in income statement standard model * only add required data tags * remove calculations data * use `name` key instead of `tag` key * set `period` as required in data * remove `period` and `cik` from provider models * add `equity/fundamental/search_financial_attributes` with tests * clean descriptions file * add `equity/fundamental/financial_attributes` with tests * set `value` as `Optional` * Fix threadpool test error (#5734) * Remove ultima from deps (#5736) * remove ultima from deps * skip ultima test * black * change skip location * try except statement to avoid error on the ci * new currency reference rates pr (#5724) * point files to linters (#5739) * remove news from equity (#5741) * Add tiingo provider (#5740) * first commit * things * Add news endpoints * CryptoHistorical * Add currency and trailing dividend yield * things working * deps * fix pre commit things * tests? * black on the tests * pratty told me to add it * integration tests * added helpers * crypto revamped * currency revamped * trailing dividend yield revamped * equity historical revamped * company news overhauled * global news overhauled * remove `tags` param from news models * crypto correct `exchanges` description * james smh * re-recorded fetcher tests * fixed integration tests * econometrics smh * james smh again --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Add `derivatives` extension for `futures` and `options` (#5742) * removed options and futures * add derivatives extension * cleanup * bug #5649 (#5722) * bug #5649 * fixing --a upmom, downmom --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Rename the fmp search -> screener (#5744) * Rename the fmp search -> screener * misses some * i cant copy paste * docs/fix-urls: Updates the Terminal About URLs to match `/develop` (#5720) * update Terminal about URLs and some other broken links * ruff * intro * changing the heading levels * dependency management sections * structure * developer guides * structure * contributor guides * keywords and descriptions * broken urls * cool cards * Cool cards (#5727) * tidy up terminal/content * some more tidy up * fix styling for platform that was missing * more tidy up * improve color for dark and light mode * create new reference card for more basic cards * rename back to menus * implement all index.md for terminal, except reference * improve bot title * more refactoring * fix remaining index * header styling * more styling * heheheheheheeh * Revert "heheheheheheeh" This reverts commit7d095fcfd2. * Ccards (#5733) * links * more links * improved styling and chevron aligned to title * fix index.mdx urls for Terminal * update package.json * update index.mdx * fix generation * spelling * toolkit_extensions * update data extensions * couple of links * add tiingo to data extensions list --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: James Maslek <jmaslek11@gmail.com> * Stock leftover cleanup (#5745) * change to equity in `.md` files * `HistoricalStockSplits`->`HistoricalSplits` * `StockInsiderTrading`->`InsiderTrading` * sorry fmp * `EquityHistorical` cleanup * `EquityNBBO` cleanup * .md leftover * the last of stocks * Hotfix/urllib to dev group (#5732) * use the urllib3 dependency on the dev group instead * adapt the version script for the nightlies - if it's a nightly the package distribution name will have a different name * add dev dependencies to the dev installation bc of the ci * updating the import on validate_call according to: https://docs.pydantic.dev/latest/concepts/validation_decorator/ the way we were importing it breaks if pydanti… * [Docs] Guides for Metadata and AnnotatedResult (#6457) * [Docs] Redirect contributing URL (#6460) * redirect url * order * [Release] 4.2.2 (#6480) * Docs/update xl docs (#6145) * remove print * update obb.get docs * example * md lint * fix get reference (#6147) * [BugFix] Filter OECD data using `start_date` and `end_date` parameters (#6144) * move constant dicts to constants.py filter by start_date and end_date * black * black again again * Merge 'main' into 'develop' (#6151) * Release/3.2.4 (#5696) * test * ultima description (#5541) * Updating showcase page (#5543) * updating showcase page * use sdk instead * add new bot command autopost docs (#5530) add new bot command autopost docs to docs.openbb.co Co-authored-by: James Maslek <jmaslek11@gmail.com> * Hotfix/ultima improvements (#5553) * tweaks for monetization * fix linting issue * fix: Modify 'load' behavior to append data to existing sheet (#5503) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Fixed 'worksheet not found' error during export to an existing sheet * Changes: * Now if the sheet exists in the xlsx file it will ask the user if he wants to replace/append/create new sheet --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * added platform API integration test to Nightly build (#5571) * Add columns to `stocks/search` (#5565) * Add columns to `stocks/search` isin, cusip, figi, composite_figi, shareclass_figi * Update test_search[False].txt * Update test_search[True].txt * Delete tests/openbb_terminal/stocks/cassettes/test_stocks_helper/test_search.yaml * Create test_search.yaml --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * updating ultima urls (#5587) * fix: A value is trying to be set on a copy of a slice from a DataFrame #5582 (#5591) * Update README.md (#5598) * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * fix docs (#5646) * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update settings.md (#5665) * fix front matter (#5667) * #5633 adding comma every 1000 (#5652) * #5633 adding comma every 1000 * pylint --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Hotfix/reports model render report sanitize inputs (#5669) * Adding more robust special character handling to create_output_path().Addresses https://github.com/OpenBB-finance/OpenBBTerminal/issues/5299 * Running black linter on code to conform to OBB style guides. --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * hotfix/fix-gov-histcont: Fix #5650 - /stocks/gov/histcont (#5676) * fix histcont * some cleanup * remove sort line * 12-31 not 12-12 * columns_keep_types * remove space in regex (#5675) * Pin openai (#5685) * Clarified stocks/ta empty recom object message (#5468) * Clarified stocks/ta empty recom object message * black * lint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * improved market cap value extraction (#5169) * improved market cap value extraction * pylint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * 3.2.3->3.2.4 * Changelogs * new changelog --------- Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Andrew <andrew.kenreich@gmail.com> Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Luqman <luqazino@gmail.com> Co-authored-by: Adwait <111136306+AdwaitSalankar@users.noreply.github.com> Co-authored-by: Abhishek Amar <66067391+abhishek-amar@users.noreply.github.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Ramazan <guvencramazan@outlook.com> Co-authored-by: joshuabuildsthings <joshuabuildsthings@users.noreply.github.com> Co-authored-by: wojda <114031148+polooner@users.noreply.github.com> Co-authored-by: Bim Phomthong <118195204+bimbolimbo@users.noreply.github.com> * Release/4.0.1 (#5840) * test * ultima description (#5541) * Updating showcase page (#5543) * updating showcase page * use sdk instead * add new bot command autopost docs (#5530) add new bot command autopost docs to docs.openbb.co Co-authored-by: James Maslek <jmaslek11@gmail.com> * Hotfix/ultima improvements (#5553) * tweaks for monetization * fix linting issue * fix: Modify 'load' behavior to append data to existing sheet (#5503) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Fixed 'worksheet not found' error during export to an existing sheet * Changes: * Now if the sheet exists in the xlsx file it will ask the user if he wants to replace/append/create new sheet --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * added platform API integration test to Nightly build (#5571) * Add columns to `stocks/search` (#5565) * Add columns to `stocks/search` isin, cusip, figi, composite_figi, shareclass_figi * Update test_search[False].txt * Update test_search[True].txt * Delete tests/openbb_terminal/stocks/cassettes/test_stocks_helper/test_search.yaml * Create test_search.yaml --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * updating ultima urls (#5587) * fix: A value is trying to be set on a copy of a slice from a DataFrame #5582 (#5591) * Update README.md (#5598) * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * fix docs (#5646) * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update settings.md (#5665) * fix front matter (#5667) * #5633 adding comma every 1000 (#5652) * #5633 adding comma every 1000 * pylint --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Hotfix/reports model render report sanitize inputs (#5669) * Adding more robust special character handling to create_output_path().Addresses https://github.com/OpenBB-finance/OpenBBTerminal/issues/5299 * Running black linter on code to conform to OBB style guides. --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * hotfix/fix-gov-histcont: Fix #5650 - /stocks/gov/histcont (#5676) * fix histcont * some cleanup * remove sort line * 12-31 not 12-12 * columns_keep_types * remove space in regex (#5675) * Pin openai (#5685) * Clarified stocks/ta empty recom object message (#5468) * Clarified stocks/ta empty recom object message * black * lint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * improved market cap value extraction (#5169) * improved market cap value extraction * pylint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Release/3.2.4 (#5704) * 3.2.3->3.2.4 * Changelogs * new changelog * OpenBB Platform v4 (#5225) * change location * check something * add cache * fixed auth w/@IgorWounds and @montezdesousa * fixes for econometrics * include Darren auth suggestions * some routers included if dev + chg hub backend var * coverage router should not be here * update docker readme * forgot to check auth here * Change extension imports * update docstrings and readme * headers function wasnt being called, just referenced * relative import * econometrics add headers everywhere * Fix QA * Fix TA * Fix test * Fix python interface QA and TA * Lint * Cleanup * Change path * make the changes and some etf models * tests for command_runner * ruff * solving naming issues on pytest * Update some docstrings, fix typos and lint * solving econometrics instantiating wrong openbb * chaging the way pytest runs * messing around with the imports * ruff * Change template to add platform considerations (#5533) * change template to add platform considerations * @the-praxs suggestions * solving __pycache__ issue * removing typo * ci yml * making linters happy (i guess) * Improve Omega Ratio and docstrings * chaging pro validation hash * ruff * Fix OLS Summary and lint * Add OECD Provider for economy extension (#5534) * Add record to docs * update a couple of cboe models * Fix econometrics bugs. Make tests pass. Lint. * black * ruff * pydantic v2: remove deprecated Extra * pydantic v2: self.dict -> self.model_dump * revert pydantic * revert the revert * try 1: pin urllib3 < 2 * Revert "try 1: pin urllib3 < 2" This reverts commit3736c311cb. * Revert dep * Fix * re-lock * Skip all tests when doing cspell in pre-commit * Resolve linter errors * Add OECD to install script * Add OECD * Resolve more linter errors * Exclude static files of v4 python from ruff * More linting * Another attempt to resolve even more linting errors * Change how Literal is used * ticker. symbol. consistent. @piiq * change ticker field in Stock Search to is_symbol * Update Cboe model for stocks_search -> is_symbol parameter. * Fix issue * Lint * Small QA to rename SDK to Platform (#5544) * SDK -> Platform in docs * renamed in core * renamed in openbb `init` * `sdk` variable renamed as `platform` --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * `validator` -> `field_validator` in standard models * Standard convention for multi-ticker symbols (#5549) * standardize symbol input param in forex and crypto historical data * static * linting * Fix stock_search integration test params * Update dependencies and linting on the CI (#5550) * Remove ruff and black from platform dependencies * Update codespell configuration * Lint python code * Add toml and tomli to root dev dependencies * Update requirements.txt files * Fix buggy docstring in python package methods (#5548) * fix buggy docstring for methods * remove space * fix typing * avoid name collision with validator * Revert "avoid name collision with validator" This reverts commit8a30a44555. * typing * rebuild * python 3.8, ParamSpec not available * lint * ruff noqa * Merge with develop (#5551) * Charting extension integration tests (#5547) * initial proposal for integration tests on the charting extension * int tests for charting generation * python generator * ruff * boilerplate templates * python tests * tests for the api * using body instead so data don't get redefined * unit tests for coverage * ruff * docstrings * unnecessary access to keys() * Add trading economics economic calendar * dev install * Data Models disposition on the website (#5538) * pydantic v4 * flat structure * md files * Revert "md files" This reverts commitbd2170e2ad. * improve command descriptions * nice title and description * human readble data model names on left panel * implementation details section * content markdown files * markdown versioned files * showcase page * updates --------- Co-authored-by: tehcoderer <me@tehcoderer.com> * everything except tests * fix `datetime.date` import in fetcher test * modified url to remove `api_key` placeholder * record test * api key is called c here * fixed fetcher test for api key * recorded tests * refactor * life is ruff * codespell * Make Intrinio options chains great again (#5540) * add multithreading * cleanup * linting * use dateutil.parser * removed `TICKER_EXCEPTIONS` * modified `date` and `type` fields in standard model * set alias for `date` and `type` to match standards * static * static * Hotfix/fix post tests (#5555) * Fix econometrics * Fix ta * Fix qa. Remove intrinio to not be rate limited * Lint * Fix typo * obbject tests (#5558) * obbject tests * ruff * fix dev_install * fix unittests * black on nox * black on nox * nox * fix fetcher test so it can compare dates * fix intrinio tests * ruff * change to model_dum() instead (#5561) * Passing tests (#5560) * Passing tests * fix options * Fix most tests and bugs * fix forex missing params * make symbol upper in polygon fx pairs * fix fixedincome integration tests (#5564) * Fixing charting api integration tests (#5562) * fixing charting api integration tests * black * fix stocks less five API fails * fix the 5 failing stocks integration tests * recapture fmp stock news unit test * fix fmp forex api test * couple more forex integration fixes * changing the request to always use the legacy session. @jmaslek this is was broken for 3.8 and 3.9; with this change apparently all versions work - lemme know if you see any issue with this change * ruff * fix ta * add missing param * fix testers for the api * fix globalnews to use images instead of image * remove unncessary pandas import * econcal int tests * update gitignore * fix get_querystring to support lists * add missing parameters --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> * Stock Historical standardization and UX improvements (#5457) * polygon add interval standard param * attempt at standardization * Alpha Vantage params standardization * rename `get_intervals` and fixed bug for extracting wrong value * missed changing it in `extract_data` * linting * polygon cleanup * modified `start_date` & `end_date` type to `datetime` from `dateType` * standardized intrinio stock historical params * fixed yfinance * linting * revert start and end date to dateType from datetime * fix alpha vantage * changed param * fix intrinio infinite loop * `validator` is `field_validator` * revert time params and fixed intervals * `outputsize` alias set in `Field` * set interval description using in-build dict * yfinance stock param standardization * static * intrinio cleanup * Polygon add api params as `PrivateAttr` * modified yfinance params to `PrivateAttr` * intrinio remove overriding date params * fixed description for AV adjusted param * fix alpha vantage intraday not working * re-record and pass unit tests * pass integration tests * Update test --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * Fix econcal endpoint (#5567) * fix econcal for python interface * fix econcal tests * fix non supported json output * Fixes FMP index endpoint to get 1 day interval data (#5535) * fix FMP endpoint for getting index data for `1day` interval * fix `open` type to prevent validation error * modifed `validator` to `field_validator` * type of fields is `StrictFloat` * re-record and pass test * linting * `validator` -> `field_validator`, a3'd everything * Fix regression in tests. Lint * updating the integration test actions * Fix typo * Fix typo * Fix import * Publish versions `a3` to Pypi (#5568) * bump versions and script to publish * small improvements * uncomment exception * openbb * publishing guidelines * improve docs * add providers to economy api * make symbol required in stock_quote * Fix keys * Fix oecd * add comma * revert * Add quotes * Sleep * Improve tests * Improve * Feature/query transform (#5566) * inject query into transform_data * swap query and data * update missing fetchers * last test failing * sig test fetcher * black * av add `query` to `transform_data` call * transform_data: missing refactoring * fix uvicorn command in the doc * Automated examples (#5576) * Automated examples * Fix bug * Lint * static assets built on 3.8 * Revert "static assets built on 3.8" This reverts commitfb82ff7bd9. * remove assets * static assets on 3.8 * static assets on 3.8 * Wrap in quotes * Improve wrap * minor fix * rebuild 3.8 * Fix bug * Fix edge case * Lint * rebuild --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> * use SecretStr for sensitive fields (#5578) * use SecretStr for sensitive fields * fix * docstring * Add tests for provider (#5583) * Add tests for provider * Test standard models * Lint * Fix standard model issues. Co-authored-by: @the-praxs * linting * `symbol` -> `is_symbol` in `economy.index_search` * static --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * feature/v4-biztoc-provider: Adds Biztoc provider and GlobalNews (#5546) * add biztoc provider * duplicate field * black * request headers * recapture test * move stuff around * add integration tests * duplicate OECD entry in dev_install * duplicate entry for oecd in pyproject.toml * Add Biztoc to workflow * update readme: credentials * Add Preferences to README * improve tests * fix biztoc * obbject pylint * Bug fix: serializ SecretStr before dumping to json * export credentials as json (#5592) * Check for wrong, changed, or outdated params. (#5597) * Improving `economy.cpi` for the FRED data (#5602) * remove multiindex using coding magic * Update field descriptions --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Improve error message. * Improve * Test tests (#5607) * Test tests * Add test * 4.0.0a4 PyPI publishing (#5608) * changes to publish * fix mini conflict * typo * cleaned `descriptions.py` * fix description in `cpi.py` * Add ETF extension to v4 (#5609) * Add etf extension with search data model * Add FMP ETF search * Add fetcher tests * Add ETF historical price from yfinance (#5610) * Add etf extension with search data model * Add FMP ETF search * Add fetcher tests * Add etf historical price standard model and route * Add etf historical data from yfinance * Add unit tests * Fix linter error. Organize imports * Update test data * Revert common descriptions erased by CPI PR * remove `symbol` from data for `stocks.ca.peers` * Test docstrings (#5613) * Test docstrings * fix minor bugs w/@IgorWounds * static only w/@IgorWounds * fix `importance` param in `economy.econcal` * right static only w/@IgorWounds * Fix econcal and add tests to noxfile * fix econcal static * re-record --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Clean up the newly created ETF extension (#5611) * Add ETF to dev_install bundle * Add integration tests for openbb-etf * Patch integration test generator scripts to produce lintable code * Add py.typed markers for extensions * user preferences descriptions (#5593) * user preferences descriptions * typo * Feature/v4-sec-provider: Add SEC provider to V4 (#5556) * coerce string type, add default=None * add sec provider and FTD function * update description * ruff * data model definitions in standard model already * duplicate oecd entries in dev_install and pyproject * actually commit * integration test * add stock search to SEC * add company filings for SEC provider * integration tests * remove duplicated line * ruff * **kwargs in Transform Data * some helper functions for later * black * add helper for mutual fund and etf lookup * add some SEC lookup helpers to a new regulators extension * black * ruff * fix test param * take institution filter out of sec stock_search * ruff * remove URL that codespell doesn't like * add cik-to-ticker map * add litigations rss feed * make openbb-regulators a dependency of openbb-sec * add SIC search * improve ftd and remove BeautifulSoup from SEC dependencies * fix parsing the zip files pre-2009 * ruff * update descriptions * recapture ftd test * tests params * typo * change limit param to 1 in test_sec_stock_ftd * Add didiers to_records method (#5588) * Add didiers to_records * unused import * Bring back polars + do what igor suggested * Make the output consistent with what it was. * Black ? * spelling. oops. almost like we have a pre commit or something * Feature/v4-price-performance: % returns for various horizons, comparable across multiple tickers. (#5618) * coerce string type, add default=None * add price_performance endpoint from FMP * black * extra period in docstring * ruff * forgot one file * Feature/ipo-calendar: V4 IPO Calendar (#5605) * coerce string type, add default=None * add intrinio ipo calendar * fix typo * sort __init__ * fix description * make requested changes * update test params * black * test updates * etf integration * Add disc router and WSJ provider * OBBject extensions (#5612) * changes to core * bug? * docstring * doc * Update credentials.py * fix model_dump * create extensions * fix docstring * doc * revert change query_exc * doc * fix container test * redirect obbject test patch * doc * rename method * move decorator to extension file * rename method extend_obbject * changes in creds model * avoid credential racing * doc * rename prop * doc * doc * remove comment * comment some code * free extension names * docstring * doc * docs * Hotfix/fix-v4-economic-calendar: Add FMP to Econ Calendar and fix some TE bugs (#5580) * coerce string type, add default=None * adds fmp to economic calendar and fixes some things with TE * ruff * etf integration test * missing provider for test * rename te cassette to economic_calendar * fix test * rename tests --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Add stocks disc endpoints (#5630) * Add stocks disc endpoints * Explicit * Lint * Add tests * Bump timeout * Feature/disc router (#5616) * Add disc router and WSJ provider * Lint * Lint * Move endpoints under ETF router * Update etf_performance.py * Add ETF info and sector exposure from FMP (#5620) * Add ETF info from FMP * Add integration tests * Add unit tests * Add etf sectors endpoint * Add etf sectors fmp endpoint * Omit nested sector list from fmp info data * Update tests and test data * Update test data * Specify provider explicitly in integration tests * Update tests * Skip yfinance etf historical test * Fix linter errors after the merge * Fix more linter errors * Fix failing and add missing tests * Fix integration tests * Fix calendar ipo tests * Add ETF holdings and holding report dates from FMP (#5629) * Add ETF info from FMP * Add integration tests * Add unit tests * Add etf sectors endpoint * Add etf sectors fmp endpoint * Omit nested sector list from fmp info data * Update tests and test data * Update test data * Specify provider explicitly in integration tests * Update tests * Skip yfinance etf historical test * Add etf holdings and holdings date routes and standard models * Add fmp holdings and holding dates fetchers * Update holdings fetcher to properly handle date object inputs * Add unit tests * Add integration tests * Black after merge * Fix test input data format * Disc router for equities. (#5640) * Disc router for equities. * add tests * Bug fixes in financial statements (#5537) * `validator` to `field_validator` in standard models * Polygon add `ttm` to `period` param * Revert "Polygon add `ttm` to `period` param" * Polygon add `ttm` to param `period` * `EarningsCallTranscript` standard model removed `quarter` param * use `tag` instead of `name` for correct field name * fix url for intrinio income statement * modified intrinio cash flow `transform_data` function * set optional data fields and validate dates * fix insider trading not fetching recent data * linting * refactoring * refactoring * set param alias in fmp stock insider provider model * get all quarter data for intrinio * add `limit` param to `stocks.fa.ins` * refactoring and linting * removed additional comment * linting * re-recorded and fix tests * cash flow standard model field type to `StrictFloat` * Intrinio cash flow model fixed to get all quarters' data * linting * refactoring * financial statement standard model field type to `StrictFloat` * Intrinio financial statement model get all quarter data * set `period` type to `Optional[str]` * add `period` param to balance sheet provider models * add `period` param to cash flow provider models * use alias in model dump * remove `ttm` from `period` param * revamped intrinio financials * fixed incorrect description for `limit` param * modified tests for `balance`, `cash` and `income` * re-recorded tests * skipped intrinio financial statement fetcher tests * Add ETF county weighting command with FMP data (#5645) * Remove code that wrongfully infers the filing date as end of quarter * Add etf countries command with fmp data * Add countries command to etf router * Update sector and country weighting fmp models * Fix docstring typo * Add unit tests and update mock data * Add integration tests for etf.countries * Bring back missing integration tests * Fix economic calendar integration tests * fix missing data in intrinio financials * removed inutile params from Polygon financial statement models * Intrinio IPO overhaul * tests fixed and re-recorded * Add ETF holdings performance with FMP data (#5659) * Add etf holdings performance endpoint * Add tests * Fix failing polygon fetcher tests * Split long holdings lists into chunks and update test data * Change chunk length to 500 tickers * Add stock search from FMP (#5642) Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Feature/v4 pypi (#5579) * improvements to the publish script * move scripts * initial script that builds the package * adjustments on the docs * test pypi workflow * add hour and minute to version * black * ruff * duplicate file * moving files instead * build throught the script instead * update nox file * integration tests workflow * change workflow * fix dev_install * fix in sed cmd * testing the platform only * commenting out the publishing * fix run commands * improvements to the publish script and doc * fix publish script * updating the script and the workflow * feature/v4-pypi nightly (#5589) * init * Update nightly.py * cleanup * init file * not referencing dev_utils * updating obb platform key * revert * Increase warmup time * project name on pyproject and adding the --pre flag on readme * moving to the build folder * fix noxfile * reflecting the moves on the import statements * fix pyproject path * ruff * fix paths * fix super typo * update workflows * moving the pypi terminal files into its folder --------- Co-authored-by: teh_coderer <me@tehcoderer.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * economy.calendar nasdaq (#5628) * add quandl econcal * unittest * add integration tests * replace   * fix bug TE importance * small fix * remove stuff from quandl * add nasdaq provider * add nasdaq to install files * Update test_economy_api.py * test * quandl leftovers * remove quandl econcal test * lint * replace   * ruff * lint * update nasdaq gmt * validate countries * here * no need for this * fix calendar tests * static * static * remove error * static * readme + website * readme * remove changes TE * typo * fix unittest * fix tests * Update __init__.py * Update economic_calendar.py * revamped model and added helpers for date range --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Feature/v4-dividend-calendar: Adds Nasdaq dividend calendar and moves the command out of fundamental_analysis (#5672) * add nasdaq dividend calendar and move out of fundamental_analysis * black * ruff * add random-user-agent to pyproject.toml * add nasdaq ipo calendar * add nasdaq flag for SPO to IPO calendar * add spo test param * black * dividend test * fix transform_query - nasdaq_calendar_ipo * bring back different headers for ipo calendar * remove references to test * Add disc endpoints (#5660) * Add Quandl top retail * Add tests * Add Seeking Alpha * Add Filings * Change Provider * Fix test * Add dev_install * static * static correct * y u forget me * updated deps * static --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * using dev install (#5673) * Expanding the `fixedincome` menu (#5655) * models and fetcher * making the fetcher visible * std model * adding the command * improvements to the models * typo * adding the command * imrpovements to dwpcr * standard model for ecb int rates * adding the fetcher for fred * standard model of ice bofa * add ice_bofa command * ruff * ice bofa fetcher * moody std model * moody * std model * add cp command * unused import * cp * spot * ruff * hqm * tmc * ffrmc * tbffr * ruff * typing fixes * buggy dates * fred fetcher tests * ruff * adding ecb as a provider * adding new provider related stuff * adding the new command eu_ycvr * models * test for ecb fetcher * Feature/v4 fixedincome int tests (#5661) * integration tests * happy ruff * mini adjustment * ruff * typo * verbose type * fix tests * docstrings everywhere and an happy pydocstyle * fix tests * Feature/user-cache-dir: Add User Preference for the Cache Directory (#5621) * add user preference for storing cached data * ruff * fix tests? * fix test key error..? * etf integration test fix * add cache dir to SEC * black * improve docs structure for V4 (#5586) * improve docs structure for V4 * moving over changes * Add Docs to the navbar * add some, re-order sidebar * fix sentence * add docs install to source instructions * insert a couple of links, fix a typo * big terminal docs usage revamps * improve toggle component for tutorials * get rid of TOCs for all terminal docs for consistency and simplicity * improve platform docs * improve bot docs content structure * remove index from bot docs * improve ON THIS PAGE to only display TOC if at least 1 element * make edit this page text and icon on same line * add author and date to docs * add basic syntax page to usage * sidebar order for usage section * move api start command to the top with the import python import * some install page additions * small improvement * refactor routines section * Update introduction-to-routines.md * Update pipeline-of-commands.md * Update introduction-to-routines.md * Update routines-for-power-users.md * Update community-routines.md * update keyboard hotkey macros * askobb page * Update askobb-feature.md * Update index.md * Update index.md * Update index.md * Update index.md * fix images * remove HeadTitle from all files where it exist * get rid of extra spacing in markdown * small update * small edit * need index at the start because of main path when homepage of docs * use openAI to create SEO for front matter on my behalf * remove table of content from sdk page * finish improving metadata SEO for SDK docs * update duplicate header * update HeadTitle to be more specific on product * remove index from bot telegram reference * delete duplicated title for platform reference * another update * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * start PR so screenshots can get attached via GitHub website * Update qa.md * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * Update crypto introduction.md * titles * another title * Update crypto dd.md * Update defi.md * Update disc.md * Update nft.md * Update onchain.md * Update ov.md * Update introduction.md updates URL * Update introduction.md add HeadTitle * Update ba.md * Update comparison.md * Update dark-pool-shorts.md * Update disc.md * fix docs (#5646) * Update fa.md * Update gov.md * Update ins.md * Update tradinghours.md * Delete website/content/terminal/menus/stocks/options/screener.md * Update Options introduction.md * Update screener head title * Update screener TOC * Update econometrics.md * Update economy head title * Update etf.md * codespell * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Contributing guidelines (#5615) * intro section * what's expected sections * improve sections * improve sections and move how to add a data point * moving qa under contributor * better intro * moving the sharing section * better expectations * small intro to the contributor guidelines * moving things under the contributor section * there is no pre commits on the platform yet * dependency management * best practices for extensions * typo * collapse options subfolder * codespell * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update fixedincome.md * url * Update forecast.md * Update settings.md (#5665) * Update forex.md * fix front matter (#5667) * Fix conflict markers that got into markdown during previous merges * Fix front matter list formatting * Fix typo * small thing * fix hyperlinks * Update .codespell.ignore * output_type options * Architectural considerations * Update sidebar to hide pro section by default * Minor copy changes * TET pattern * import statements * clarification on preferences * Minor copy changes * Lint markdown and python * fix: open index on collapsible root elements * remove old content * options title * Fix linting errors * Refactor sidebar label to url mapping condition --------- Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Add multi-ticker support to etf_countries (#5670) * add multi-ticker support to etf_countries * remove commented-out lines * normalized percent points * percent -> percentage * Fix Nasdaq Econ Calendar Fetcher (#5668) * fix nasdaq econ cal request * more html tags * add random-user-agent to pyproject * another edge case - 24H -> 00:00 * Feature/v4-unusual-options: Adds unusual options endpoint. (#5677) * add unusual options fro Intrinio * test params * move sorting * Change type * update FMP fetcher to use the V4 endpoint (#5681) * Fix price performance not parsed correctly when there is only 1 ticker (#5678) * Add crypto search standard model and FMP data for it (#5679) * Apply renaming to news data (#5684) * inegration complete * reformatted for black * fix ruff issues * revised integration * changes to versions in pyproject.toml and updated lock files * Rename models * Update tests * Fix typos here and there * Update routers * Apply rename to ultima * Properly mock api key * Mock ultima api key --------- Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> * Feature/v4-market-snapshots: Adds full market snapshots (#5473) * add stocks market snapshots from fmp * add fmp fetcher test * unused imports * add polygon to market_snapshots * update fmp market_snapshots * black * pydantic2 things * updates * change validate_obj to model_validate * polygon cleanup * tests * descriptions * black * data description * minor adjustments, using less local variables, improving readability and removing pandas * better structure * minor adjustments * lint * fix int tests --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Add NBBO Quotes, with historical, to `obb.stocks.quote()` (#5617) * coerce string type, add default=None * add polygon stock quote * limit cleanup * add greater/less than to params * limit param * black * tests * fix tests * test_etf * rename model and function to NBBO * add standard model for nbbo * improve standardization * not redifining builtin max * fix input params * integration test params * removing unused import Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * revamped code * re-recorded nbbo test * added symbol validator * added alias in field * Stock news -> Company news --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * hotfix/update-quandl-to-nasdaq: Merge Quandl + Nasdaq (#5682) * merge quandl nd nasdaq * dev_install.py * test param name * economy python integration test * Add more input types to data processing commands (#5453) * adding more supported types to data processing commands * ruff * removing unused import * docstrings * data processing types covertion * data description * test filters * ruff * fix package builder tests * ruff * removing print * Add stocks/dps module (#5638) * short volume * pyproject missed * add sec short interest with days to cover * Add FINRA OTC endopoint * some tests * rest of unit tests * Integratin test scripts * dev install * linters caught by pre commit * lines too long * Last test files * maybe it needs a lock file? * thanks pratty * Maybe ill actually listen to pratty next time * sec test date freeze * I cant hit buttons * re record tests * tests 3 * Stockgrid test * regen int test * more testing * lint * moved these fns * dis killing me * one more test * last one * Update integration tests * Fix tests picking up wrong dps route --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Rename Forex to Currency (#5687) * restore fields as optional (#5686) * Rename Crypto (#5689) * added `crypto.price.historical` * static * fix tests * fix incorrect label * Move model from sec to finra (#5692) * Update toml * fixed deps * add openbb-etf lock file * cleanup * cleanup (#5694) * Rename Fixed Income (#5695) * Rename Fixed Income * Add routers * Rename stocks to equity (#5688) * Rename stocks folder * Rename openbb_stocks package * Rename routers * Reroute equity menu * Update routes based on feedback * StockNews -> EquityNews * StockInfo -> EquityProfile * Rename Equity calendars * Equity peers rename * Rename discovery * Rename fundamental * Rename price command models * Rename shorts * Update charting router * Fix seeking alpha upcoming release date * Fix linting errors * Update tests * Fix tests * Skip econometrics api tests because it's python only * Update integration tests and test data * Historical analyst estimates * Skip cboe options chain test. Unable to record vcr cassette * re-record cboe cassettes * Document CBOE unit test creation caveats --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Feature/files-for-igor: Adding a few standard models for Igor (#5699) * add some standard models for Igor * codespell * update descriptions * Add devtools metapackage (#5703) * Add openbb-devtools metapackage * adding devtools to the dev_install script --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Rename econometrics commands to be more verbose (#5702) * Expose command to model map (#5706) * Rename ta qa (#5708) * Rename ta folder * Rename ta to technical * Rename qa folder * Rename qa to quantitative * Rename the actual routes in quantitative * Equity cleanup (#5707) * cleanup * static * renaming to equity cc @the-praxs * Proof reading --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Don't enforce imperative for first word of the docstring * Remove ultima from default extensions * Rename `economy` and create `index` extension (#5705) * renamed economy and re-recorded tests * static * market indices * european indices * fred indices * index constituents * tests * correct package name * oops * static * linting * Move COT commands to regulators * Rename economy.list to available_indices * Rename GDP models and clean up * Fix charting tests * Drop _indices from available_indices command * Fix obbject to_dict test --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Rename etf/disc (#5715) * Docs/v4-working-docs: PR to Work on V4 Docs (#5693) * Revert changes related to pydantic2 made into v3 code * Revert fred model changes in v3 * Revert pydantic2 databento model changes in v2 * Update some names and v3 lock file * Clean up openbb/package before the beta release * Platform publishing procedure (#5701) * update instructions * introducing the version script * publish message * fix platform path * reflecting version changes * getting version from installed packages instead * removing toml from dependencies * Changes to get `a7` out (#5697) * changes to get a7 out * etf menu on the pyproject.toml * poetry lock * bump `openbb-etf` to `a5` to match version * updated deps * removing ultima * removing references to a4 cc @the-praxs * Bump index menu version * poetry lock --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Update publishing instructions * Bump core dependencies in extensions and providers * Add changes to the publish script following the beta release * Update the versions in static extension map and openbb metapackage --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: tehcoderer <me@tehcoderer.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> * Hotfix/pypi openbb terminal (#5719) * renaming the project * documentation changes * Finishing touches to the publishing procedure (#5728) * finishing touches to the publishing procedure * grammar improvements * Run tests on develop (#5725) * Run tests on develop * Add a check that files changes in platform * Seprate Intrinio financials data tags into a different command (#5723) * add `ebit` field in income statement standard model * only add required data tags * remove calculations data * use `name` key instead of `tag` key * set `period` as required in data * remove `period` and `cik` from provider models * add `equity/fundamental/search_financial_attributes` with tests * clean descriptions file * add `equity/fundamental/financial_attributes` with tests * set `value` as `Optional` * Fix threadpool test error (#5734) * Remove ultima from deps (#5736) * remove ultima from deps * skip ultima test * black * change skip location * try except statement to avoid error on the ci * new currency reference rates pr (#5724) * point files to linters (#5739) * remove news from equity (#5741) * Add tiingo provider (#5740) * first commit * things * Add news endpoints * CryptoHistorical * Add currency and trailing dividend yield * things working * deps * fix pre commit things * tests? * black on the tests * pratty told me to add it * integration tests * added helpers * crypto revamped * currency revamped * trailing dividend yield revamped * equity historical revamped * company news overhauled * global news overhauled * remove `tags` param from news models * crypto correct `exchanges` description * james smh * re-recorded fetcher tests * fixed integration tests * econometrics smh * james smh again --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Add `derivatives` extension for `futures` and `options` (#5742) * removed options and futures * add derivatives extension * cleanup * bug #5649 (#5722) * bug #5649 * fixing --a upmom, downmom --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Rename the fmp search -> screener (#5744) * Rename the fmp search -> screener * misses some * i cant copy paste * docs/fix-urls: Updates the Terminal About URLs to match `/develop` (#5720) * update Terminal about URLs and some other broken links * ruff * intro * changing the heading levels * dependency management sections * structure * developer guides * structure * contributor guides * keywords and descriptions * broken urls * cool cards * Cool cards (#5727) * tidy up terminal/content * some more tidy up * fix styling for platform that was missing * more tidy up * improve color for dark and light mode * create new reference card for more basic cards * rename back to menus * implement all index.md for terminal, except reference * improve bot title * more refactoring * fix remaining index * header styling * more styling * heheheheheheeh * Revert "heheheheheheeh" This reverts commit7d095fcfd2. * Ccards (#5733) * links * more links * improved styling and chevron aligned to title * fix index.mdx urls for Terminal * update package.json * update index.mdx * fix generation * spelling * toolkit_extensions * update data extensions * couple of links * add tiingo to data extensions list --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: James Maslek <jmaslek11@gmail.com> * Stock leftover cleanup (#5745) * change to equity in `.md` files * `HistoricalStockSplits`->`HistoricalSplits` * `StockInsiderTrading`->`InsiderTrading` * sorry fmp * `EquityHistorical` cleanup * `EquityNBBO` cleanup * .md leftover * the last of stocks * Hotfix/urllib to dev group (#5732) * use the urllib3 dependency on the dev group instead * adapt the version script for the nightlies - if it's a nightly the package distribution name will have a different name * add dev dependencies to the dev installation bc of the ci * updating the import on validate_call according to: https://docs.pydantic.dev/latest/concepts/validation_decorator/ the way we were importing it breaks if pydantic=2.5 @montezdesousa * loosing urllib3 version specification on the provider and adding it to platform dev deps * rmeoving urllib from top level deps; and removing --with dev flag * changing to ^ instead * Revert "changing to ^ instead" This reverts commit7300904e9f. * unnecessary dep --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> * feature/v4-bop - Add ECB Balance of Payments (Replaces #5716) (#5726) * add ecb balance of payments * missing __init__.py files * Nasdaq calendar earnings and fix FMP calendar earnings (#5718) Co-authored-by: James Maslek <jmaslek11@gmail.com> * feature/us-treasury-auctions: Adds Treasury Auctions endpoint and provider for US Government Data. (#5746) * add government_us provider and treasury auctions endpoint * black * add param for cusip * move logic for setting default start/end date * Update hub<>platform credentials map (#5749) * update hub<>platform credentials map * typo * Add API settings schema to system settings (#5743) Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> * Skip checking creds (#5737) * skip checking creds * fix bug * ok mypy * add comment * rename required_credentials * fix * fix top_retail bug * don't require creds in some nasdaq fetchers * black * this was not here before * fix tests * update fetcher test * update contributing guidelines * Fix Quote (#5752) * Fix Quote * fixed return type and model validation --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Wrap up renaming global news to world news on a model level (#5750) * Wrap up renaming global news to world news on a model level * cleanup --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Remove eod from docstrings (#5751) * Wrap up renaming global news to world news on a model level * Remove "end of day" from historical price model docstrings --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Massive docstring cleanup (#5755) * sec router remove command * standard models cleanup * fmp cleanup * av cleanup * benzinga cleanup * biztoc cleanup * cboe cleanup * ecb cleanup * finra cleanup * fred cleanup * us cleanup * intrinio cleanup * nasdaq cleanup * oecd cleanup * polygon cleanup * sec cleanup * seeking alpha cleanup * stockgrid cleanup * tiingo cleanup * tradingeconomics cleanup * ultima cleanup * wsj cleanup * yfinance cleanup * sec router lint * fix date query param description * Updates system and api settings (#5753) * remove uncessary import on rest api * remove FrozenField and add api.version * allow setup from json * remove id tag * computed field is better * formatting --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Squeeze build time (#5756) * squeeze build time * bug fix * fix test * typo? * rebuild * keep tradingeconomics * docs/working-docs: Working V4 Docs PR (#5747) * post-install clarification, fix links * more links * change word * toolkit cleanup * rename 'contributing' to 'development' * update extensions * some urls * Update sdk-platform and v4-develop in urls (#5730) * Update sdk-platform and v4-develop in urls * Seprate Intrinio financials data tags into a different command (#5723) * add `ebit` field in income statement standard model * only add required data tags * remove calculations data * use `name` key instead of `tag` key * set `period` as required in data * remove `period` an… * [Docs] Fix Broken URLs (#6494) * fix broken urls * couple more * remove poetry install openbb_platform from docs generation. * Try it this way. * [Docs] Excel docs update (#6504) * update xl docs * update xl files * Release/4.2.3 (#6517) * [Release] 4.1.5 to `develop` (#6192) * Release/3.2.4 (#5696) * test * ultima description (#5541) * Updating showcase page (#5543) * updating showcase page * use sdk instead * add new bot command autopost docs (#5530) add new bot command autopost docs to docs.openbb.co Co-authored-by: James Maslek <jmaslek11@gmail.com> * Hotfix/ultima improvements (#5553) * tweaks for monetization * fix linting issue * fix: Modify 'load' behavior to append data to existing sheet (#5503) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Fixed 'worksheet not found' error during export to an existing sheet * Changes: * Now if the sheet exists in the xlsx file it will ask the user if he wants to replace/append/create new sheet --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * added platform API integration test to Nightly build (#5571) * Add columns to `stocks/search` (#5565) * Add columns to `stocks/search` isin, cusip, figi, composite_figi, shareclass_figi * Update test_search[False].txt * Update test_search[True].txt * Delete tests/openbb_terminal/stocks/cassettes/test_stocks_helper/test_search.yaml * Create test_search.yaml --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * updating ultima urls (#5587) * fix: A value is trying to be set on a copy of a slice from a DataFrame #5582 (#5591) * Update README.md (#5598) * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * fix docs (#5646) * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update settings.md (#5665) * fix front matter (#5667) * #5633 adding comma every 1000 (#5652) * #5633 adding comma every 1000 * pylint --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Hotfix/reports model render report sanitize inputs (#5669) * Adding more robust special character handling to create_output_path().Addresses https://github.com/OpenBB-finance/OpenBBTerminal/issues/5299 * Running black linter on code to conform to OBB style guides. --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * hotfix/fix-gov-histcont: Fix #5650 - /stocks/gov/histcont (#5676) * fix histcont * some cleanup * remove sort line * 12-31 not 12-12 * columns_keep_types * remove space in regex (#5675) * Pin openai (#5685) * Clarified stocks/ta empty recom object message (#5468) * Clarified stocks/ta empty recom object message * black * lint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * improved market cap value extraction (#5169) * improved market cap value extraction * pylint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * 3.2.3->3.2.4 * Changelogs * new changelog --------- Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Andrew <andrew.kenreich@gmail.com> Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Luqman <luqazino@gmail.com> Co-authored-by: Adwait <111136306+AdwaitSalankar@users.noreply.github.com> Co-authored-by: Abhishek Amar <66067391+abhishek-amar@users.noreply.github.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Ramazan <guvencramazan@outlook.com> Co-authored-by: joshuabuildsthings <joshuabuildsthings@users.noreply.github.com> Co-authored-by: wojda <114031148+polooner@users.noreply.github.com> Co-authored-by: Bim Phomthong <118195204+bimbolimbo@users.noreply.github.com> * Release/4.0.1 (#5840) * test * ultima description (#5541) * Updating showcase page (#5543) * updating showcase page * use sdk instead * add new bot command autopost docs (#5530) add new bot command autopost docs to docs.openbb.co Co-authored-by: James Maslek <jmaslek11@gmail.com> * Hotfix/ultima improvements (#5553) * tweaks for monetization * fix linting issue * fix: Modify 'load' behavior to append data to existing sheet (#5503) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Fixed 'worksheet not found' error during export to an existing sheet * Changes: * Now if the sheet exists in the xlsx file it will ask the user if he wants to replace/append/create new sheet --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * added platform API integration test to Nightly build (#5571) * Add columns to `stocks/search` (#5565) * Add columns to `stocks/search` isin, cusip, figi, composite_figi, shareclass_figi * Update test_search[False].txt * Update test_search[True].txt * Delete tests/openbb_terminal/stocks/cassettes/test_stocks_helper/test_search.yaml * Create test_search.yaml --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * updating ultima urls (#5587) * fix: A value is trying to be set on a copy of a slice from a DataFrame #5582 (#5591) * Update README.md (#5598) * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * fix docs (#5646) * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update settings.md (#5665) * fix front matter (#5667) * #5633 adding comma every 1000 (#5652) * #5633 adding comma every 1000 * pylint --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Hotfix/reports model render report sanitize inputs (#5669) * Adding more robust special character handling to create_output_path().Addresses https://github.com/OpenBB-finance/OpenBBTerminal/issues/5299 * Running black linter on code to conform to OBB style guides. --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * hotfix/fix-gov-histcont: Fix #5650 - /stocks/gov/histcont (#5676) * fix histcont * some cleanup * remove sort line * 12-31 not 12-12 * columns_keep_types * remove space in regex (#5675) * Pin openai (#5685) * Clarified stocks/ta empty recom object message (#5468) * Clarified stocks/ta empty recom object message * black * lint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * improved market cap value extraction (#5169) * improved market cap value extraction * pylint --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Release/3.2.4 (#5704) * 3.2.3->3.2.4 * Changelogs * new changelog * OpenBB Platform v4 (#5225) * change location * check something * add cache * fixed auth w/@IgorWounds and @montezdesousa * fixes for econometrics * include Darren auth suggestions * some routers included if dev + chg hub backend var * coverage router should not be here * update docker readme * forgot to check auth here * Change extension imports * update docstrings and readme * headers function wasnt being called, just referenced * relative import * econometrics add headers everywhere * Fix QA * Fix TA * Fix test * Fix python interface QA and TA * Lint * Cleanup * Change path * make the changes and some etf models * tests for command_runner * ruff * solving naming issues on pytest * Update some docstrings, fix typos and lint * solving econometrics instantiating wrong openbb * chaging the way pytest runs * messing around with the imports * ruff * Change template to add platform considerations (#5533) * change template to add platform considerations * @the-praxs suggestions * solving __pycache__ issue * removing typo * ci yml * making linters happy (i guess) * Improve Omega Ratio and docstrings * chaging pro validation hash * ruff * Fix OLS Summary and lint * Add OECD Provider for economy extension (#5534) * Add record to docs * update a couple of cboe models * Fix econometrics bugs. Make tests pass. Lint. * black * ruff * pydantic v2: remove deprecated Extra * pydantic v2: self.dict -> self.model_dump * revert pydantic * revert the revert * try 1: pin urllib3 < 2 * Revert "try 1: pin urllib3 < 2" This reverts commit3736c311cb. * Revert dep * Fix * re-lock * Skip all tests when doing cspell in pre-commit * Resolve linter errors * Add OECD to install script * Add OECD * Resolve more linter errors * Exclude static files of v4 python from ruff * More linting * Another attempt to resolve even more linting errors * Change how Literal is used * ticker. symbol. consistent. @piiq * change ticker field in Stock Search to is_symbol * Update Cboe model for stocks_search -> is_symbol parameter. * Fix issue * Lint * Small QA to rename SDK to Platform (#5544) * SDK -> Platform in docs * renamed in core * renamed in openbb `init` * `sdk` variable renamed as `platform` --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * `validator` -> `field_validator` in standard models * Standard convention for multi-ticker symbols (#5549) * standardize symbol input param in forex and crypto historical data * static * linting * Fix stock_search integration test params * Update dependencies and linting on the CI (#5550) * Remove ruff and black from platform dependencies * Update codespell configuration * Lint python code * Add toml and tomli to root dev dependencies * Update requirements.txt files * Fix buggy docstring in python package methods (#5548) * fix buggy docstring for methods * remove space * fix typing * avoid name collision with validator * Revert "avoid name collision with validator" This reverts commit8a30a44555. * typing * rebuild * python 3.8, ParamSpec not available * lint * ruff noqa * Merge with develop (#5551) * Charting extension integration tests (#5547) * initial proposal for integration tests on the charting extension * int tests for charting generation * python generator * ruff * boilerplate templates * python tests * tests for the api * using body instead so data don't get redefined * unit tests for coverage * ruff * docstrings * unnecessary access to keys() * Add trading economics economic calendar * dev install * Data Models disposition on the website (#5538) * pydantic v4 * flat structure * md files * Revert "md files" This reverts commitbd2170e2ad. * improve command descriptions * nice title and description * human readble data model names on left panel * implementation details section * content markdown files * markdown versioned files * showcase page * updates --------- Co-authored-by: tehcoderer <me@tehcoderer.com> * everything except tests * fix `datetime.date` import in fetcher test * modified url to remove `api_key` placeholder * record test * api key is called c here * fixed fetcher test for api key * recorded tests * refactor * life is ruff * codespell * Make Intrinio options chains great again (#5540) * add multithreading * cleanup * linting * use dateutil.parser * removed `TICKER_EXCEPTIONS` * modified `date` and `type` fields in standard model * set alias for `date` and `type` to match standards * static * static * Hotfix/fix post tests (#5555) * Fix econometrics * Fix ta * Fix qa. Remove intrinio to not be rate limited * Lint * Fix typo * obbject tests (#5558) * obbject tests * ruff * fix dev_install * fix unittests * black on nox * black on nox * nox * fix fetcher test so it can compare dates * fix intrinio tests * ruff * change to model_dum() instead (#5561) * Passing tests (#5560) * Passing tests * fix options * Fix most tests and bugs * fix forex missing params * make symbol upper in polygon fx pairs * fix fixedincome integration tests (#5564) * Fixing charting api integration tests (#5562) * fixing charting api integration tests * black * fix stocks less five API fails * fix the 5 failing stocks integration tests * recapture fmp stock news unit test * fix fmp forex api test * couple more forex integration fixes * changing the request to always use the legacy session. @jmaslek this is was broken for 3.8 and 3.9; with this change apparently all versions work - lemme know if you see any issue with this change * ruff * fix ta * add missing param * fix testers for the api * fix globalnews to use images instead of image * remove unncessary pandas import * econcal int tests * update gitignore * fix get_querystring to support lists * add missing parameters --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> * Stock Historical standardization and UX improvements (#5457) * polygon add interval standard param * attempt at standardization * Alpha Vantage params standardization * rename `get_intervals` and fixed bug for extracting wrong value * missed changing it in `extract_data` * linting * polygon cleanup * modified `start_date` & `end_date` type to `datetime` from `dateType` * standardized intrinio stock historical params * fixed yfinance * linting * revert start and end date to dateType from datetime * fix alpha vantage * changed param * fix intrinio infinite loop * `validator` is `field_validator` * revert time params and fixed intervals * `outputsize` alias set in `Field` * set interval description using in-build dict * yfinance stock param standardization * static * intrinio cleanup * Polygon add api params as `PrivateAttr` * modified yfinance params to `PrivateAttr` * intrinio remove overriding date params * fixed description for AV adjusted param * fix alpha vantage intraday not working * re-record and pass unit tests * pass integration tests * Update test --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * Fix econcal endpoint (#5567) * fix econcal for python interface * fix econcal tests * fix non supported json output * Fixes FMP index endpoint to get 1 day interval data (#5535) * fix FMP endpoint for getting index data for `1day` interval * fix `open` type to prevent validation error * modifed `validator` to `field_validator` * type of fields is `StrictFloat` * re-record and pass test * linting * `validator` -> `field_validator`, a3'd everything * Fix regression in tests. Lint * updating the integration test actions * Fix typo * Fix typo * Fix import * Publish versions `a3` to Pypi (#5568) * bump versions and script to publish * small improvements * uncomment exception * openbb * publishing guidelines * improve docs * add providers to economy api * make symbol required in stock_quote * Fix keys * Fix oecd * add comma * revert * Add quotes * Sleep * Improve tests * Improve * Feature/query transform (#5566) * inject query into transform_data * swap query and data * update missing fetchers * last test failing * sig test fetcher * black * av add `query` to `transform_data` call * transform_data: missing refactoring * fix uvicorn command in the doc * Automated examples (#5576) * Automated examples * Fix bug * Lint * static assets built on 3.8 * Revert "static assets built on 3.8" This reverts commitfb82ff7bd9. * remove assets * static assets on 3.8 * static assets on 3.8 * Wrap in quotes * Improve wrap * minor fix * rebuild 3.8 * Fix bug * Fix edge case * Lint * rebuild --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> * use SecretStr for sensitive fields (#5578) * use SecretStr for sensitive fields * fix * docstring * Add tests for provider (#5583) * Add tests for provider * Test standard models * Lint * Fix standard model issues. Co-authored-by: @the-praxs * linting * `symbol` -> `is_symbol` in `economy.index_search` * static --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * feature/v4-biztoc-provider: Adds Biztoc provider and GlobalNews (#5546) * add biztoc provider * duplicate field * black * request headers * recapture test * move stuff around * add integration tests * duplicate OECD entry in dev_install * duplicate entry for oecd in pyproject.toml * Add Biztoc to workflow * update readme: credentials * Add Preferences to README * improve tests * fix biztoc * obbject pylint * Bug fix: serializ SecretStr before dumping to json * export credentials as json (#5592) * Check for wrong, changed, or outdated params. (#5597) * Improving `economy.cpi` for the FRED data (#5602) * remove multiindex using coding magic * Update field descriptions --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Improve error message. * Improve * Test tests (#5607) * Test tests * Add test * 4.0.0a4 PyPI publishing (#5608) * changes to publish * fix mini conflict * typo * cleaned `descriptions.py` * fix description in `cpi.py` * Add ETF extension to v4 (#5609) * Add etf extension with search data model * Add FMP ETF search * Add fetcher tests * Add ETF historical price from yfinance (#5610) * Add etf extension with search data model * Add FMP ETF search * Add fetcher tests * Add etf historical price standard model and route * Add etf historical data from yfinance * Add unit tests * Fix linter error. Organize imports * Update test data * Revert common descriptions erased by CPI PR * remove `symbol` from data for `stocks.ca.peers` * Test docstrings (#5613) * Test docstrings * fix minor bugs w/@IgorWounds * static only w/@IgorWounds * fix `importance` param in `economy.econcal` * right static only w/@IgorWounds * Fix econcal and add tests to noxfile * fix econcal static * re-record --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Clean up the newly created ETF extension (#5611) * Add ETF to dev_install bundle * Add integration tests for openbb-etf * Patch integration test generator scripts to produce lintable code * Add py.typed markers for extensions * user preferences descriptions (#5593) * user preferences descriptions * typo * Feature/v4-sec-provider: Add SEC provider to V4 (#5556) * coerce string type, add default=None * add sec provider and FTD function * update description * ruff * data model definitions in standard model already * duplicate oecd entries in dev_install and pyproject * actually commit * integration test * add stock search to SEC * add company filings for SEC provider * integration tests * remove duplicated line * ruff * **kwargs in Transform Data * some helper functions for later * black * add helper for mutual fund and etf lookup * add some SEC lookup helpers to a new regulators extension * black * ruff * fix test param * take institution filter out of sec stock_search * ruff * remove URL that codespell doesn't like * add cik-to-ticker map * add litigations rss feed * make openbb-regulators a dependency of openbb-sec * add SIC search * improve ftd and remove BeautifulSoup from SEC dependencies * fix parsing the zip files pre-2009 * ruff * update descriptions * recapture ftd test * tests params * typo * change limit param to 1 in test_sec_stock_ftd * Add didiers to_records method (#5588) * Add didiers to_records * unused import * Bring back polars + do what igor suggested * Make the output consistent with what it was. * Black ? * spelling. oops. almost like we have a pre commit or something * Feature/v4-price-performance: % returns for various horizons, comparable across multiple tickers. (#5618) * coerce string type, add default=None * add price_performance endpoint from FMP * black * extra period in docstring * ruff * forgot one file * Feature/ipo-calendar: V4 IPO Calendar (#5605) * coerce string type, add default=None * add intrinio ipo calendar * fix typo * sort __init__ * fix description * make requested changes * update test params * black * test updates * etf integration * Add disc router and WSJ provider * OBBject extensions (#5612) * changes to core * bug? * docstring * doc * Update credentials.py * fix model_dump * create extensions * fix docstring * doc * revert change query_exc * doc * fix container test * redirect obbject test patch * doc * rename method * move decorator to extension file * rename method extend_obbject * changes in creds model * avoid credential racing * doc * rename prop * doc * doc * remove comment * comment some code * free extension names * docstring * doc * docs * Hotfix/fix-v4-economic-calendar: Add FMP to Econ Calendar and fix some TE bugs (#5580) * coerce string type, add default=None * adds fmp to economic calendar and fixes some things with TE * ruff * etf integration test * missing provider for test * rename te cassette to economic_calendar * fix test * rename tests --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Add stocks disc endpoints (#5630) * Add stocks disc endpoints * Explicit * Lint * Add tests * Bump timeout * Feature/disc router (#5616) * Add disc router and WSJ provider * Lint * Lint * Move endpoints under ETF router * Update etf_performance.py * Add ETF info and sector exposure from FMP (#5620) * Add ETF info from FMP * Add integration tests * Add unit tests * Add etf sectors endpoint * Add etf sectors fmp endpoint * Omit nested sector list from fmp info data * Update tests and test data * Update test data * Specify provider explicitly in integration tests * Update tests * Skip yfinance etf historical test * Fix linter errors after the merge * Fix more linter errors * Fix failing and add missing tests * Fix integration tests * Fix calendar ipo tests * Add ETF holdings and holding report dates from FMP (#5629) * Add ETF info from FMP * Add integration tests * Add unit tests * Add etf sectors endpoint * Add etf sectors fmp endpoint * Omit nested sector list from fmp info data * Update tests and test data * Update test data * Specify provider explicitly in integration tests * Update tests * Skip yfinance etf historical test * Add etf holdings and holdings date routes and standard models * Add fmp holdings and holding dates fetchers * Update holdings fetcher to properly handle date object inputs * Add unit tests * Add integration tests * Black after merge * Fix test input data format * Disc router for equities. (#5640) * Disc router for equities. * add tests * Bug fixes in financial statements (#5537) * `validator` to `field_validator` in standard models * Polygon add `ttm` to `period` param * Revert "Polygon add `ttm` to `period` param" * Polygon add `ttm` to param `period` * `EarningsCallTranscript` standard model removed `quarter` param * use `tag` instead of `name` for correct field name * fix url for intrinio income statement * modified intrinio cash flow `transform_data` function * set optional data fields and validate dates * fix insider trading not fetching recent data * linting * refactoring * refactoring * set param alias in fmp stock insider provider model * get all quarter data for intrinio * add `limit` param to `stocks.fa.ins` * refactoring and linting * removed additional comment * linting * re-recorded and fix tests * cash flow standard model field type to `StrictFloat` * Intrinio cash flow model fixed to get all quarters' data * linting * refactoring * financial statement standard model field type to `StrictFloat` * Intrinio financial statement model get all quarter data * set `period` type to `Optional[str]` * add `period` param to balance sheet provider models * add `period` param to cash flow provider models * use alias in model dump * remove `ttm` from `period` param * revamped intrinio financials * fixed incorrect description for `limit` param * modified tests for `balance`, `cash` and `income` * re-recorded tests * skipped intrinio financial statement fetcher tests * Add ETF county weighting command with FMP data (#5645) * Remove code that wrongfully infers the filing date as end of quarter * Add etf countries command with fmp data * Add countries command to etf router * Update sector and country weighting fmp models * Fix docstring typo * Add unit tests and update mock data * Add integration tests for etf.countries * Bring back missing integration tests * Fix economic calendar integration tests * fix missing data in intrinio financials * removed inutile params from Polygon financial statement models * Intrinio IPO overhaul * tests fixed and re-recorded * Add ETF holdings performance with FMP data (#5659) * Add etf holdings performance endpoint * Add tests * Fix failing polygon fetcher tests * Split long holdings lists into chunks and update test data * Change chunk length to 500 tickers * Add stock search from FMP (#5642) Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Feature/v4 pypi (#5579) * improvements to the publish script * move scripts * initial script that builds the package * adjustments on the docs * test pypi workflow * add hour and minute to version * black * ruff * duplicate file * moving files instead * build throught the script instead * update nox file * integration tests workflow * change workflow * fix dev_install * fix in sed cmd * testing the platform only * commenting out the publishing * fix run commands * improvements to the publish script and doc * fix publish script * updating the script and the workflow * feature/v4-pypi nightly (#5589) * init * Update nightly.py * cleanup * init file * not referencing dev_utils * updating obb platform key * revert * Increase warmup time * project name on pyproject and adding the --pre flag on readme * moving to the build folder * fix noxfile * reflecting the moves on the import statements * fix pyproject path * ruff * fix paths * fix super typo * update workflows * moving the pypi terminal files into its folder --------- Co-authored-by: teh_coderer <me@tehcoderer.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * economy.calendar nasdaq (#5628) * add quandl econcal * unittest * add integration tests * replace   * fix bug TE importance * small fix * remove stuff from quandl * add nasdaq provider * add nasdaq to install files * Update test_economy_api.py * test * quandl leftovers * remove quandl econcal test * lint * replace   * ruff * lint * update nasdaq gmt * validate countries * here * no need for this * fix calendar tests * static * static * remove error * static * readme + website * readme * remove changes TE * typo * fix unittest * fix tests * Update __init__.py * Update economic_calendar.py * revamped model and added helpers for date range --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Feature/v4-dividend-calendar: Adds Nasdaq dividend calendar and moves the command out of fundamental_analysis (#5672) * add nasdaq dividend calendar and move out of fundamental_analysis * black * ruff * add random-user-agent to pyproject.toml * add nasdaq ipo calendar * add nasdaq flag for SPO to IPO calendar * add spo test param * black * dividend test * fix transform_query - nasdaq_calendar_ipo * bring back different headers for ipo calendar * remove references to test * Add disc endpoints (#5660) * Add Quandl top retail * Add tests * Add Seeking Alpha * Add Filings * Change Provider * Fix test * Add dev_install * static * static correct * y u forget me * updated deps * static --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * using dev install (#5673) * Expanding the `fixedincome` menu (#5655) * models and fetcher * making the fetcher visible * std model * adding the command * improvements to the models * typo * adding the command * imrpovements to dwpcr * standard model for ecb int rates * adding the fetcher for fred * standard model of ice bofa * add ice_bofa command * ruff * ice bofa fetcher * moody std model * moody * std model * add cp command * unused import * cp * spot * ruff * hqm * tmc * ffrmc * tbffr * ruff * typing fixes * buggy dates * fred fetcher tests * ruff * adding ecb as a provider * adding new provider related stuff * adding the new command eu_ycvr * models * test for ecb fetcher * Feature/v4 fixedincome int tests (#5661) * integration tests * happy ruff * mini adjustment * ruff * typo * verbose type * fix tests * docstrings everywhere and an happy pydocstyle * fix tests * Feature/user-cache-dir: Add User Preference for the Cache Directory (#5621) * add user preference for storing cached data * ruff * fix tests? * fix test key error..? * etf integration test fix * add cache dir to SEC * black * improve docs structure for V4 (#5586) * improve docs structure for V4 * moving over changes * Add Docs to the navbar * add some, re-order sidebar * fix sentence * add docs install to source instructions * insert a couple of links, fix a typo * big terminal docs usage revamps * improve toggle component for tutorials * get rid of TOCs for all terminal docs for consistency and simplicity * improve platform docs * improve bot docs content structure * remove index from bot docs * improve ON THIS PAGE to only display TOC if at least 1 element * make edit this page text and icon on same line * add author and date to docs * add basic syntax page to usage * sidebar order for usage section * move api start command to the top with the import python import * some install page additions * small improvement * refactor routines section * Update introduction-to-routines.md * Update pipeline-of-commands.md * Update introduction-to-routines.md * Update routines-for-power-users.md * Update community-routines.md * update keyboard hotkey macros * askobb page * Update askobb-feature.md * Update index.md * Update index.md * Update index.md * Update index.md * fix images * remove HeadTitle from all files where it exist * get rid of extra spacing in markdown * small update * small edit * need index at the start because of main path when homepage of docs * use openAI to create SEO for front matter on my behalf * remove table of content from sdk page * finish improving metadata SEO for SDK docs * update duplicate header * update HeadTitle to be more specific on product * remove index from bot telegram reference * delete duplicated title for platform reference * another update * Hotfix/econometrics export filename fix (#5508) * fix: Modify 'load' behavior to append data to existing sheet Details: - Added logic to detect existing sheet and append data if present. - There is no direct way to append on the sheet, so I am reading the sheet to get the last row number and then writing after that row number. Resolves: #5472 * Added --export option for exporting to a desired file in /econometrics menu * Added a -f/--file option to provide the filename for export. Made -t/--type and -f/--file mutually exclusive. If -f is not given, -t is required and the filename will be generated based on the time and module. * Revert `helper_funcs.py` to original state * Made some arguments not required. * Minor changes asked by @deeleeramone * No sheet name * black --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * FIX #5600 Updated the Twitter logo to X logo (#5601) * Change Ultima paragraph (#5624) * change ultima paragraph * remove old paragraph * Update CONTRIBUTING.md (#5623) * mobile line-brake fixed (#5604) In the mobile view (media max 400px ), the text line "Installation >>" appears broken into smaller segments. Co-authored-by: James Maslek <jmaslek11@gmail.com> * start PR so screenshots can get attached via GitHub website * Update qa.md * Docs/terminalpro and improvement (#5622) * add first iteration of content for Terminal Pro * Update index.md * Update dashboards.md * Update folders.md * Update grouping.md * Update report.md * Update templates.md * Update quick-start.md * Update index.md * Update index.md * Update home.md * Update news.md * Update index.md * Update index.md * Update index.md * Update data-provider.md * Update chat-with-widget.md * Update data-manipulation.md * Update forecasting.md * fix: images self closing tags * fix: only pro visitors can see pro * inter font * improve SEO content and restructuring * add new package for toggle on tutorials * move folder around * improve main page of each prod * small updates and improvements * fix logo above * small improvement in headtitle for portfolio funcs * fix typos from OpenAI's GPT-4 * fix _category_ json * remove generic SEO words * add script that generates SEO for documentation * add missing file * remove sdk warning message * fix links for andrew --------- Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Add light blue banner, blue when clicking sidebar + fix link in docusaurus.config.js (#5627) * typo * pro docs tab coloring * sidebar selection blue * redirecting missing * Update crypto introduction.md * titles * another title * Update crypto dd.md * Update defi.md * Update disc.md * Update nft.md * Update onchain.md * Update ov.md * Update introduction.md updates URL * Update introduction.md add HeadTitle * Update ba.md * Update comparison.md * Update dark-pool-shorts.md * Update disc.md * fix docs (#5646) * Update fa.md * Update gov.md * Update ins.md * Update tradinghours.md * Delete website/content/terminal/menus/stocks/options/screener.md * Update Options introduction.md * Update screener head title * Update screener TOC * Update econometrics.md * Update economy head title * Update etf.md * codespell * Fix the redirect for intro to the correct url for docs (#5658) * fix the redirect for intro to the correct url for docs * fix code linting --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> * Contributing guidelines (#5615) * intro section * what's expected sections * improve sections * improve sections and move how to add a data point * moving qa under contributor * better intro * moving the sharing section * better expectations * small intro to the contributor guidelines * moving things under the contributor section * there is no pre commits on the platform yet * dependency management * best practices for extensions * typo * collapse options subfolder * codespell * Improve Pro documentation further (#5641) * small improvement * Fix TutorialVideo for mobile view * main page terminal pro docs * jose whelp * placeholder index file that needs to be removed * fix: fixes sidebar, removes unused index.md * update link to api keys * update api keys link * fix hyperlinks in terminal helper * fix a few more links * fix some more links * linter * black linter * improve main docs page for each product * small refactor * header to take to main page of product * run OpenAI script to generate SEO for pro content --------- Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> * Update folders.md * Update integrate-your-own-backend.md * Update index.md * Update fixedincome.md * url * Update forecast.md * Update settings.md (#5665) * Update forex.md * fix front matter (#5667) * Fix conflict markers that got into markdown during previous merges * Fix front matter list formatting * Fix typo * small thing * fix hyperlinks * Update .codespell.ignore * output_type options * Architectural considerations * Update sidebar to hide pro section by default * Minor copy changes * TET pattern * import statements * clarification on preferences * Minor copy changes * Lint markdown and python * fix: open index on collapsible root elements * remove old content * options title * Fix linting errors * Refactor sidebar label to url mapping condition --------- Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Add multi-ticker support to etf_countries (#5670) * add multi-ticker support to etf_countries * remove commented-out lines * normalized percent points * percent -> percentage * Fix Nasdaq Econ Calendar Fetcher (#5668) * fix nasdaq econ cal request * more html tags * add random-user-agent to pyproject * another edge case - 24H -> 00:00 * Feature/v4-unusual-options: Adds unusual options endpoint. (#5677) * add unusual options fro Intrinio * test params * move sorting * Change type * update FMP fetcher to use the V4 endpoint (#5681) * Fix price performance not parsed correctly when there is only 1 ticker (#5678) * Add crypto search standard model and FMP data for it (#5679) * Apply renaming to news data (#5684) * inegration complete * reformatted for black * fix ruff issues * revised integration * changes to versions in pyproject.toml and updated lock files * Rename models * Update tests * Fix typos here and there * Update routers * Apply rename to ultima * Properly mock api key * Mock ultima api key --------- Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> * Feature/v4-market-snapshots: Adds full market snapshots (#5473) * add stocks market snapshots from fmp * add fmp fetcher test * unused imports * add polygon to market_snapshots * update fmp market_snapshots * black * pydantic2 things * updates * change validate_obj to model_validate * polygon cleanup * tests * descriptions * black * data description * minor adjustments, using less local variables, improving readability and removing pandas * better structure * minor adjustments * lint * fix int tests --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Add NBBO Quotes, with historical, to `obb.stocks.quote()` (#5617) * coerce string type, add default=None * add polygon stock quote * limit cleanup * add greater/less than to params * limit param * black * tests * fix tests * test_etf * rename model and function to NBBO * add standard model for nbbo * improve standardization * not redifining builtin max * fix input params * integration test params * removing unused import Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * revamped code * re-recorded nbbo test * added symbol validator * added alias in field * Stock news -> Company news --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * hotfix/update-quandl-to-nasdaq: Merge Quandl + Nasdaq (#5682) * merge quandl nd nasdaq * dev_install.py * test param name * economy python integration test * Add more input types to data processing commands (#5453) * adding more supported types to data processing commands * ruff * removing unused import * docstrings * data processing types covertion * data description * test filters * ruff * fix package builder tests * ruff * removing print * Add stocks/dps module (#5638) * short volume * pyproject missed * add sec short interest with days to cover * Add FINRA OTC endopoint * some tests * rest of unit tests * Integratin test scripts * dev install * linters caught by pre commit * lines too long * Last test files * maybe it needs a lock file? * thanks pratty * Maybe ill actually listen to pratty next time * sec test date freeze * I cant hit buttons * re record tests * tests 3 * Stockgrid test * regen int test * more testing * lint * moved these fns * dis killing me * one more test * last one * Update integration tests * Fix tests picking up wrong dps route --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Rename Forex to Currency (#5687) * restore fields as optional (#5686) * Rename Crypto (#5689) * added `crypto.price.historical` * static * fix tests * fix incorrect label * Move model from sec to finra (#5692) * Update toml * fixed deps * add openbb-etf lock file * cleanup * cleanup (#5694) * Rename Fixed Income (#5695) * Rename Fixed Income * Add routers * Rename stocks to equity (#5688) * Rename stocks folder * Rename openbb_stocks package * Rename routers * Reroute equity menu * Update routes based on feedback * StockNews -> EquityNews * StockInfo -> EquityProfile * Rename Equity calendars * Equity peers rename * Rename discovery * Rename fundamental * Rename price command models * Rename shorts * Update charting router * Fix seeking alpha upcoming release date * Fix linting errors * Update tests * Fix tests * Skip econometrics api tests because it's python only * Update integration tests and test data * Historical analyst estimates * Skip cboe options chain test. Unable to record vcr cassette * re-record cboe cassettes * Document CBOE unit test creation caveats --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Feature/files-for-igor: Adding a few standard models for Igor (#5699) * add some standard models for Igor * codespell * update descriptions * Add devtools metapackage (#5703) * Add openbb-devtools metapackage * adding devtools to the dev_install script --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Rename econometrics commands to be more verbose (#5702) * Expose command to model map (#5706) * Rename ta qa (#5708) * Rename ta folder * Rename ta to technical * Rename qa folder * Rename qa to quantitative * Rename the actual routes in quantitative * Equity cleanup (#5707) * cleanup * static * renaming to equity cc @the-praxs * Proof reading --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Don't enforce imperative for first word of the docstring * Remove ultima from default extensions * Rename `economy` and create `index` extension (#5705) * renamed economy and re-recorded tests * static * market indices * european indices * fred indices * index constituents * tests * correct package name * oops * static * linting * Move COT commands to regulators * Rename economy.list to available_indices * Rename GDP models and clean up * Fix charting tests * Drop _indices from available_indices command * Fix obbject to_dict test --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Rename etf/disc (#5715) * Docs/v4-working-docs: PR to Work on V4 Docs (#5693) * Revert changes related to pydantic2 made into v3 code * Revert fred model changes in v3 * Revert pydantic2 databento model changes in v2 * Update some names and v3 lock file * Clean up openbb/package before the beta release * Platform publishing procedure (#5701) * update instructions * introducing the version script * publish message * fix platform path * reflecting version changes * getting version from installed packages instead * removing toml from dependencies * Changes to get `a7` out (#5697) * changes to get a7 out * etf menu on the pyproject.toml * poetry lock * bump `openbb-etf` to `a5` to match version * updated deps * removing ultima * removing references to a4 cc @the-praxs * Bump index menu version * poetry lock --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Update publishing instructions * Bump core dependencies in extensions and providers * Add changes to the publish script following the beta release * Update the versions in static extension map and openbb metapackage --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: tehcoderer <me@tehcoderer.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> * Hotfix/pypi openbb terminal (#5719) * renaming the project * documentation changes * Finishing touches to the publishing procedure (#5728) * finishing touches to the publishing procedure * grammar improvements * Run tests on develop (#5725) * Run tests on develop * Add a check that files changes in platform * Seprate Intrinio financials data tags into a different command (#5723) * add `ebit` field in income statement standard model * only add required data tags * remove calculations data * use `name` key instead of `tag` key * set `period` as required in data * remove `period` and `cik` from provider models * add `equity/fundamental/search_financial_attributes` with tests * clean descriptions file * add `equity/fundamental/financial_attributes` with tests * set `value` as `Optional` * Fix threadpool test error (#5734) * Remove ultima from deps (#5736) * remove ultima from deps * skip ultima test * black * change skip location * try except statement to avoid error on the ci * new currency reference rates pr (#5724) * point files to linters (#5739) * remove news from equity (#5741) * Add tiingo provider (#5740) * first commit * things * Add news endpoints * CryptoHistorical * Add currency and trailing dividend yield * things working * deps * fix pre commit things * tests? * black on the tests * pratty told me to add it * integration tests * added helpers * crypto revamped * currency revamped * trailing dividend yield revamped * equity historical revamped * company news overhauled * global news overhauled * remove `tags` param from news models * crypto correct `exchanges` description * james smh * re-recorded fetcher tests * fixed integration tests * econometrics smh * james smh again --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Add `derivatives` extension for `futures` and `options` (#5742) * removed options and futures * add derivatives extension * cleanup * bug #5649 (#5722) * bug #5649 * fixing --a upmom, downmom --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> * Rename the fmp search -> screener (#5744) * Rename the fmp search -> screener * misses some * i cant copy paste * docs/fix-urls: Updates the Terminal About URLs to match `/develop` (#5720) * update Terminal about URLs and some other broken links * ruff * intro * changing the heading levels * dependency management sections * structure * developer guides * structure * contributor guides * keywords and descriptions * broken urls * cool cards * Cool cards (#5727) * tidy up terminal/content * some more tidy up * fix styling for platform that was missing * more tidy up * improve color for dark and light mode * create new reference card for more basic cards * rename back to menus * implement all index.md for terminal, except reference * improve bot title * more refactoring * fix remaining index * header styling * more styling * heheheheheheeh * Revert "heheheheheheeh" This reverts commit7d095fcfd2. * Ccards (#5733) * links * more links * improved styling and chevron aligned to title * fix index.mdx urls for Terminal * update package.json * update index.mdx * fix generation * spelling * toolkit_extensions * update data extensions * couple of links * add tiingo to data extensions list --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: James Maslek <jmaslek11@gmail.com> * Stock leftover cleanup (#5745) * change to equity in `.md` files * `HistoricalStockSplits`->`HistoricalSplits` * `StockInsiderTrading`->`InsiderTrading` * sorry fmp * `EquityHistorical` cleanup * `EquityNBBO` cleanup * .md leftover * the last of stocks * Hotfix/urllib to dev group (#5732) * use the urllib3 dependency on the dev group instead * adapt the version script for the nightlies - if it's a nightly the package distribution name will have a different name * add dev dependencies to the dev installation bc of the ci * updating the import on validate_call according to: https://docs.pydantic.dev/latest/concepts/validation_decorator/ the way we were importing it breaks if pydantic=2.5 @montezdesousa * loosing urllib3 version specification on the provider and adding it to platform dev deps * rmeoving urllib from top level deps; and removing --with dev flag * changing to ^ instead * Revert "changing to ^ instead" This reverts commit7300904e9f. * unnecessary dep --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> * feature/v4-bop - Add ECB Balance of Payments (Replaces #5716) (#5726) * add ecb balance of payments * missing __init__.py files * Nasdaq calendar earnings and fix FMP calendar earnings (#5718) Co-authored-by: James Maslek <jmaslek11@gmail.com> * feature/us-treasury-auctions: Adds Treasury Auctions endpoint and provider for US Government Data. (#5746) * add government_us provider and treasury auctions endpoint * black * add param for cusip * move logic for setting default start/end date * Update hub<>platform credentials map (#5749) * update hub<>platform credentials map * typo * Add API settings schema to system settings (#5743) Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> * Skip checking creds (#5737) * skip checking creds * fix bug * ok mypy * add comment * rename required_credentials * fix * fix top_retail bug * don't require creds in some nasdaq fetchers * black * this was not here before * fix tests * update fetcher test * update contributing guidelines * Fix Quote (#5752) * Fix Quote * fixed return type and model validation --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Wrap up renaming global news to world news on a model level (#5750) * Wrap up renaming global news to world news on a model level * cleanup --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Remove eod from docstrings (#5751) * Wrap up renaming global news to world news on a model level * Remove "end of day" from historical price model docstrings --------- Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> * Massive docstring cleanup (#5755) * sec router remove command * standard models cleanup * fmp cleanup * av cleanup * benzinga cleanup * biztoc cleanup * cboe cleanup * ecb cleanup * finra cleanup * fred cleanup * us cleanup * intrinio cleanup * nasdaq cleanup * oecd cleanup * polygon cleanup * sec cleanup * seeking alpha cleanup * stockgrid cleanup * tiingo cleanup * tradingeconomics cleanup * ultima cleanup * wsj cleanup * yfinance cleanup * sec router lint * fix date query param description * Updates system and api settings (#5753) * remove uncessary import on rest api * remove FrozenField and add api.version * allow setup from json * remove id tag * computed field is better * formatting --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Squeeze build time (#5756) * squeeze build time * bug fix * fix test * typo? * rebuild * keep tradingeconomics * docs/working-docs: Working V4 Docs PR (#5747) * post-install clarification, fix links * more links * change word * toolkit cleanup * rename 'contributing' to 'development' * update extensions * some urls * Update sdk-platform and v4-develop in urls (#5730) * Update sdk-platform and v4-develop in urls * Seprate Intrinio financials data tags into a different command (#5723) * add `ebit` field in income statement standard model * only add required data tags * remove calculations data * use `name` key instead of `tag` key * set `period` as required in data * remove `period` and `cik` from provider models * add `equity/fundamental/search_financial_attributes` with tests * clean descriptions file * add `equity/fundamental/financial_attributes` with tests * set `value` as `Optional` * Fix threadpool test error (#5734) * Remove ultima from deps (#5736) * remove ultima from deps * … * fix: openapi bug (#6525) * Update pyproject.toml * undo biztoc lock changes * Add conda constructor code and assets * Unpin setuptools in cli * Exclude construct.yaml from linting * Try fixing regex in gha yaml linting * Don't regex gitignore * Revert "Try fixing regex in gha yaml linting" This reverts commit3fa1cd6206. * Update requirements to use pypi vs local packages * Update constructor specs * Add pro backend to the bundle * Update post install scripts and assets * Replace pinned dependencies management with the latest pypi versions * Windows Edits * [Feature] Conda Installer (#6604) * reopen PR * updating some windows things * text file edit * couple touch ups * update post_install.sh to install via poetry * readme * poetry.toml * try windows scripts * fixes * vbs poetry env use * codespell * expose uvicorn kwargs * try windows version of modified launcher * try something else * try something else * vbs api shortcut * wrong shortcut * launch windows shortcuts with cmd * windows conclusion script * add WorkingDirectory * windows python path is not in /bin * missed a shortcut WorkingDirectory * notebook windows arg syntax * cwd for notebooks * do a cd .. move * cli wrapper typo * openbb-cli * yaml * add conda * merge branch develop * fix reset_index erasing the name of the column (#6619) * handle edge case where user_settings is not formatted as expected * add welcome message and entry point for python interface build script * flag to not install conda on PATH * add condarc * condarc setting * update requirements.txt * use poetry groups for flexible post-install config * update folder structure * post install * try something for windows * no nsi_template * some updates * remove leading space. * update aiohttp for dependabot (#6621) * example extensions * install examples script * update readme * [BugFix] Fix Pandas FutureWarning In `derivatives.futures.curve` Chart (#6626) * fix Pandas FutureWarning in derivatives.futures.curve * black * codespell * [BugFix] `obb.news.world` Add Validators To Providers Where Symbol Is Mandatory (#6625) * add validators to enforce mandatory symbols in providers where required * linter * fmp 3.9 test cassette --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * data.__fields__ is deprecated - use data.model_fields instead (#6629) * some updates * difflib check * merge prompt * windows updates * cmd cwd --------- Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> * Remove redundant environment files * Fix markdown formatting * Attribute the installer metapackage to openbb * notebook launch dir * update widgets script for breaking changes and separate api entry point as an OpenBB extension. * codespell * add integration directory to openbb_platform_api * add Bls to 'to_caps' * linters * linters and typos * grammar police * grammar police * more linting * mypy * pylint * some fixes * pylint * duplicate text in welcome * add python basics notebook to examples * Improve wording and formatting in readme and installer text files * Rename OpenBB API to OpenBB Platform API to differentiate from our hosted API * user_settings bug * update multiSelect * label stuff * update readme * Rename platform api extension folder to exclude openbb. Update package name to use - vs _ * Expose a distinct endpoint per provider for each command * Refactor module files to reduce cognitive load * Minor code style improvement * Add package unit tests * Update the constructor file after platform api wrapper refactoring * Add support for get only routers * Flatten out the logic of the main function * Refactor package structure * Update schema parsing and widget generation * Return a lost function * Fix handling of parameters with optional boolean types * Update tests * Remove unused string constants * exclude envs and pkgs folders from condarc * Refactor Widgets Builder For columnsDefs (#6675) * refactor for columnsDefs * column_def field * linting * linting * linting... * fix custom provider name * don't add provider param to custom GET routers * fix some tests * fix key error in test * try fixing it another way * fix column defs edge case * Add implementation of widget filtering based on local json configuration (#6724) * Add implementation of widget filtering based on local json configuration * Update to comply with the widget_settings schema * Add --no-filter command line launch argument * Get openbb-platform-api from pypi versus local copy * Fix tests * Bring back the macos build action * Hack GHA to run the workflow right now * Fix typo and revert run on push * Try build on push again * Specify minimum python and constructor versions * Specify the constructor version * Don't just use tar bz * Add missing packages to constructor dependencies * Revert using only tar-bz * Add entitlements for code signing * Try signing the pkg using constructors native tools * Use codesigning identity name instead of ID * Get creds for James to debug * platform api readme * Add installer identity name * Fix typo in action file * codespell * Try signing _conda with application codesign id * Separate signing and deep signing into 2 steps * Comment out the Intel build action * Change --options to -o and add verbosity * Add notarization identity name to construct * Try using hash vs name for notarization * Clean up * Add Intel build * Run build scripts only on dispatch * Test if shorter widget name is working on pro * Update tests * some updates * patch openbb-platform-api * clean up empty_model * update url in root response message * silly one to build * make it start * make it not start :D * update 1 README detail * fix boolean parsing from command line and turn off uvicorn colors for Windows * linting * codespell * lazy formatting in logger * '%s' --------- Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Luqman <luqazino@gmail.com> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Michael Struwig <mnicstruwig@gmail.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: capital0 <72140796+capital0@users.noreply.github.com> Co-authored-by: Ben Van Doren <benvandoren@users.noreply.github.com> Co-authored-by: Andrew <andrew.kenreich@gmail.com> Co-authored-by: Adi Sai <adithya.sairam1@gmail.com> Co-authored-by: Sandip Saha <sandipsmoto@gmail.com> Co-authored-by: Adwait <111136306+AdwaitSalankar@users.noreply.github.com> Co-authored-by: Abhishek Amar <66067391+abhishek-amar@users.noreply.github.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: professssor <62937125+professssor@users.noreply.github.com> Co-authored-by: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Co-authored-by: MAX SHESTOV <57421753+maxxsh@users.noreply.github.com> Co-authored-by: jose-donato <zmcdonato@gmail.com> Co-authored-by: Mohamad Fadil <fadil.parves@gmail.com> Co-authored-by: Ramazan <guvencramazan@outlook.com> Co-authored-by: joshuabuildsthings <joshuabuildsthings@users.noreply.github.com> Co-authored-by: wojda <114031148+polooner@users.noreply.github.com> Co-authored-by: Bim Phomthong <118195204+bimbolimbo@users.noreply.github.com> Co-authored-by: tehcoderer <me@tehcoderer.com> Co-authored-by: Ramazan <guvencramazan@yandex.com> Co-authored-by: omahs <73983677+omahs@users.noreply.github.com> Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com> Co-authored-by: Ayrton Parkinson <ayrton.parkinson1@gmail.com> Co-authored-by: northern-64bit <75195383+northern-64bit@users.noreply.github.com> Co-authored-by: Luqman <luqman.bello@openbb.finance> Co-authored-by: Eric Li <38477812+EricLi-Dev@users.noreply.github.com> Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Co-authored-by: Henrique Joaquim <henriquecjoaquim@gmail.com> Co-authored-by: Disorder AA <disorrder@gmail.com> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: Jingyi Z <zhao.elton@gmail.com>
3849 lines
85 KiB
Plaintext
Vendored
3849 lines
85 KiB
Plaintext
Vendored
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Getting The Python Basics Right\n",
|
|
"\n",
|
|
"Special thanks to PyQuantNews for donating this content. Subscribe [here](https://www.pyquantnews.com/) for free Python resources that will help you get started with Python for Quant Finance.\n",
|
|
"\n",
|
|
"## Code Comments\n",
|
|
"\n",
|
|
"A comment is a note made by a programmer in the source code of a program. Its purpose is to clarify the source code and make it easier for people to follow along with what is happening. Anything in a comment is generally ignored when the code is actually run, making comments useful for including explanations and reasoning as well as removing specific lines of code that you may be unsure about. Comments in Python are created by using the pound symbol (`# Insert Text Here`). Including a `#` in a line of code will comment out anything that follows it."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# This is a comment\n",
|
|
"# These lines of code will not change any values\n",
|
|
"# Anything following the first # is not run as code"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"You may hear text enclosed in triple quotes (`\"\"\" Insert Text Here \"\"\"`) referred to as multi-line comments, but this is not entirely accurate. This is a special type of `string` (a data type we will cover), called a `docstring`, used to explain the purpose of a function."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"' This is a special string '"
|
|
]
|
|
},
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"\"\"\" This is a special string \"\"\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"\u001b[0;31mInit signature:\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m/\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
"\u001b[0;31mDocstring:\u001b[0m \n",
|
|
"str(object='') -> str\n",
|
|
"str(bytes_or_buffer[, encoding[, errors]]) -> str\n",
|
|
"\n",
|
|
"Create a new string object from the given object. If encoding or\n",
|
|
"errors is specified, then the object must expose a data buffer\n",
|
|
"that will be decoded using the given encoding and error handler.\n",
|
|
"Otherwise, returns the result of object.__str__() (if defined)\n",
|
|
"or repr(object).\n",
|
|
"encoding defaults to sys.getdefaultencoding().\n",
|
|
"errors defaults to 'strict'.\n",
|
|
"\u001b[0;31mType:\u001b[0m type\n",
|
|
"\u001b[0;31mSubclasses:\u001b[0m StrEnum, DeferredConfigString, FoldedCase, _rstr, _ScriptTarget, _ModuleTarget, LSString, include, Keys, InputMode, ..."
|
|
]
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"str??"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Make sure you read the comments within each code cell (if they are there). They will provide more real-time explanations of what is going on as you look at each line of code."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Python Objects - Basic Types & Variables\n",
|
|
"\n",
|
|
"Everything in Python is an **object** and every object in Python has a **type**. Some of the basic types include:\n",
|
|
"\n",
|
|
"- **`int`** (integer; a whole number with no decimal place)\n",
|
|
" - `10`\n",
|
|
" - `-3`\n",
|
|
"- **`float`** (float; a number that has a decimal place)\n",
|
|
" - `7.41`\n",
|
|
" - `-0.006`\n",
|
|
"- **`str`** (string; a sequence of characters enclosed in single quotes, double quotes, or triple quotes)\n",
|
|
" - `'this is a string using single quotes'`\n",
|
|
" - `\"this is a string using double quotes\"`\n",
|
|
" - `'''this is a triple quoted string using single quotes'''`\n",
|
|
" - `\"\"\"this is a triple quoted string using double quotes\"\"\"`\n",
|
|
"- **`bool`** (boolean; a binary value that is either true or false)\n",
|
|
" - `True`\n",
|
|
" - `False`\n",
|
|
"- **`NoneType`** (a special type representing the absence of a value)\n",
|
|
" - `None`\n",
|
|
"\n",
|
|
"In Python, a **variable** is a name you specify in your code that maps to a particular **object**, object **instance**, or value.\n",
|
|
"\n",
|
|
"By defining variables, we can refer to things by names that make sense to us. Names for variables can only contain letters, underscores (`_`), or numbers (no spaces, dashes, or other characters). Variable names must start with a letter or underscore.\n",
|
|
"\n",
|
|
"<hr>"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Basic Operators\n",
|
|
"\n",
|
|
"In Python, there are different types of **operators** (special symbols) that operate on different values. Some of the basic operators include:\n",
|
|
"\n",
|
|
"- arithmetic operators\n",
|
|
" - **`+`** (addition)\n",
|
|
" - **`-`** (subtraction)\n",
|
|
" - **`*`** (multiplication)\n",
|
|
" - **`/`** (division)\n",
|
|
" - __`**`__ (exponent)\n",
|
|
"- assignment operators\n",
|
|
" - **`=`** (assign a value)\n",
|
|
" - **`+=`** (add and re-assign; increment)\n",
|
|
" - **`-=`** (subtract and re-assign; decrement)\n",
|
|
" - **`*=`** (multiply and re-assign)\n",
|
|
"- comparison operators (return either `True` or `False`)\n",
|
|
" - **`==`** (equal to)\n",
|
|
" - **`!=`** (not equal to)\n",
|
|
" - **`<`** (less than)\n",
|
|
" - **`<=`** (less than or equal to)\n",
|
|
" - **`>`** (greater than)\n",
|
|
" - **`>=`** (greater than or equal to)\n",
|
|
"\n",
|
|
"When multiple operators are used in a single expression, **operator precedence** determines which parts of the expression are evaluated in which order. Operators with higher precedence are evaluated first (like PEMDAS in math). Operators with the same precedence are evaluated from left to right.\n",
|
|
"\n",
|
|
"- `()` parentheses, for grouping\n",
|
|
"- `**` exponent\n",
|
|
"- `*`, `/` multiplication and division\n",
|
|
"- `+`, `-` addition and subtraction\n",
|
|
"- `==`, `!=`, `<`, `<=`, `>`, `>=` comparisons\n",
|
|
"\n",
|
|
"> See https://docs.python.org/3/reference/expressions.html#operator-precedence"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Assigning some numbers to different variables\n",
|
|
"num_1 = 10\n",
|
|
"num_2 = -3\n",
|
|
"num_3 = 7.41\n",
|
|
"num_4 = -0.6\n",
|
|
"num_5 = 7\n",
|
|
"num_6 = 3\n",
|
|
"num_7 = 11.11"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"10"
|
|
]
|
|
},
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"num_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"7"
|
|
]
|
|
},
|
|
"execution_count": 6,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Addition\n",
|
|
"num_1 + num_2"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 7,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"-10.41"
|
|
]
|
|
},
|
|
"execution_count": 7,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Subtraction\n",
|
|
"num_2 - num_3"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 8,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"-4.446"
|
|
]
|
|
},
|
|
"execution_count": 8,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Multiplication\n",
|
|
"num_3 * num_4"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 9,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"-0.08571428571428572"
|
|
]
|
|
},
|
|
"execution_count": 9,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Division\n",
|
|
"num_4 / num_5"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 10,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"343"
|
|
]
|
|
},
|
|
"execution_count": 10,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Exponent\n",
|
|
"num_5**num_6"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 11,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"15.11"
|
|
]
|
|
},
|
|
"execution_count": 11,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Increment existing variable\n",
|
|
"num_7 += 4 # num_7 = num_7 + 4\n",
|
|
"num_7"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 12,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"1"
|
|
]
|
|
},
|
|
"execution_count": 12,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Decrement existing variable\n",
|
|
"num_6 -= 2\n",
|
|
"num_6"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 13,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"37.05"
|
|
]
|
|
},
|
|
"execution_count": 13,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Multiply & re-assign\n",
|
|
"num_3 *= 5\n",
|
|
"num_3"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 14,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"-101.14999999999999"
|
|
]
|
|
},
|
|
"execution_count": 14,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Assign the value of an expression to a variable\n",
|
|
"num_8 = num_1 + num_2 * num_3\n",
|
|
"num_8"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 15,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 15,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Are these two expressions equal to each other?\n",
|
|
"num_1 + num_2 == num_5"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 16,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 16,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Are these two expressions not equal to each other?\n",
|
|
"num_3 != num_4"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 17,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"False"
|
|
]
|
|
},
|
|
"execution_count": 17,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Is the first expression less than the second expression?\n",
|
|
"num_5 < num_6"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 18,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 18,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Is this expression True?\n",
|
|
"5 > 3 > 1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 19,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 19,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Is this expression True?\n",
|
|
"5 > 3 < 4 == 3 + 1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 20,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Assign some strings to different variables\n",
|
|
"simple_string_1 = \"an example\"\n",
|
|
"simple_string_2 = \"oranges \""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 21,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'an example of using the + operator'"
|
|
]
|
|
},
|
|
"execution_count": 21,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Addition\n",
|
|
"simple_string_1 + \" of using the + operator\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 22,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'an example'"
|
|
]
|
|
},
|
|
"execution_count": 22,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Notice that the string was not modified\n",
|
|
"simple_string_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 23,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'oranges oranges oranges oranges '"
|
|
]
|
|
},
|
|
"execution_count": 23,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Multiplication\n",
|
|
"simple_string_2 * 4"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 24,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'oranges '"
|
|
]
|
|
},
|
|
"execution_count": 24,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# This string wasn't modified either\n",
|
|
"simple_string_2"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 25,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"False"
|
|
]
|
|
},
|
|
"execution_count": 25,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Are these two expressions equal to each other?\n",
|
|
"simple_string_1 == simple_string_2"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 26,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 26,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Are these two expressions equal to each other?\n",
|
|
"simple_string_1 == \"an example\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 27,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'an example that re-assigned the original string'"
|
|
]
|
|
},
|
|
"execution_count": 27,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Add and re-assign\n",
|
|
"simple_string_1 += \" that re-assigned the original string\"\n",
|
|
"simple_string_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 28,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'oranges oranges oranges '"
|
|
]
|
|
},
|
|
"execution_count": 28,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Multiply and re-assign\n",
|
|
"simple_string_2 *= 3\n",
|
|
"simple_string_2"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 29,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Note: Subtraction, division, and decrement operators do not apply to strings."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Basic Data Structures\n",
|
|
"\n",
|
|
"> Note: **mutable** objects can be modified after creation and **immutable** objects cannot.\n",
|
|
"\n",
|
|
"Containers are objects that can be used to group other objects together. The basic container types include:\n",
|
|
"\n",
|
|
"- **`str`** (string: immutable; indexed by integers; items are stored in the order they were added)\n",
|
|
"- **`list`** (list: mutable; indexed by integers; items are stored in the order they were added)\n",
|
|
" - `[3, 5, 6, 3, 'dog', 'cat', False]`\n",
|
|
"- **`tuple`** (tuple: immutable; indexed by integers; items are stored in the order they were added)\n",
|
|
" - `(3, 5, 6, 3, 'dog', 'cat', False)`\n",
|
|
"- **`set`** (set: mutable; not indexed at all; items are NOT stored in the order they were added; can only contain immutable objects; does NOT contain duplicate objects)\n",
|
|
" - `{3, 5, 6, 3, 'dog', 'cat', False}`\n",
|
|
"- **`dict`** (dictionary: mutable; key-value pairs are indexed by immutable keys; items are NOT stored in the order they were added)\n",
|
|
" - `{'name': 'Jane', 'age': 23, 'fav_foods': ['pizza', 'fruit', 'fish']}`\n",
|
|
"\n",
|
|
"When defining lists, tuples, or sets, use commas (,) to separate the individual items. When defining dicts, use a colon (:) to separate keys from values and commas (,) to separate the key-value pairs.\n",
|
|
"\n",
|
|
"Strings, lists, and tuples are all **sequence types** that can use the `+`, `*`, `+=`, and `*=` operators."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 30,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Assign some containers to different variables\n",
|
|
"list_1 = [3, 5, 6, 3, \"dog\", \"cat\", False]\n",
|
|
"tuple_1 = (3, 5, 6, 3, \"dog\", \"cat\", False)\n",
|
|
"set_1 = {3, 5, 6, 3, \"dog\", \"cat\", False}\n",
|
|
"set_2 = set((\"jane\", \"jaya\", \"jukes\", \"jason\", \"john\"))\n",
|
|
"dict_1 = {\"name\": \"Jane\", \"age\": 23, \"fav_foods\": [\"pizza\", \"fruit\", \"fish\"]}\n",
|
|
"dict_2 = {\"name\": \"Javier\", \"age\": 45, \"fav_foods\": [\"chicken\", \"veg\", \"candy\"]}"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 31,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[3, 5, 6, 3, 'dog', 'cat', False]"
|
|
]
|
|
},
|
|
"execution_count": 31,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Items in the list object are stored in the order they were added\n",
|
|
"list_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 32,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"(3, 5, 6, 3, 'dog', 'cat', False)"
|
|
]
|
|
},
|
|
"execution_count": 32,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Items in the tuple object are stored in the order they were added\n",
|
|
"tuple_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 33,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{3, 5, 6, False, 'cat', 'dog'}"
|
|
]
|
|
},
|
|
"execution_count": 33,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Items in the set object are not stored in the order they were added\n",
|
|
"# Also, notice that the value 3 only appears once in this set object\n",
|
|
"set_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 34,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{'name': 'Jane', 'age': 23, 'fav_foods': ['pizza', 'fruit', 'fish']}"
|
|
]
|
|
},
|
|
"execution_count": 34,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Items in the dict object are not stored in the order they were added\n",
|
|
"dict_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 35,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[3, 5, 6, 3, 'dog', 'cat', False, 5, 'grapes']"
|
|
]
|
|
},
|
|
"execution_count": 35,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Add and re-assign\n",
|
|
"list_1 += [5, \"grapes\"]\n",
|
|
"list_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 36,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"(3, 5, 6, 3, 'dog', 'cat', False, 5, 'grapes')"
|
|
]
|
|
},
|
|
"execution_count": 36,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Add and re-assign\n",
|
|
"tuple_1 += (5, \"grapes\")\n",
|
|
"tuple_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 37,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[1, 2, 3, 4, 1, 2, 3, 4]"
|
|
]
|
|
},
|
|
"execution_count": 37,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Multiply\n",
|
|
"[1, 2, 3, 4] * 2"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 38,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"(1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4)"
|
|
]
|
|
},
|
|
"execution_count": 38,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Multiply\n",
|
|
"(1, 2, 3, 4) * 3"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Accessing Data In Containers\n",
|
|
"\n",
|
|
"For strings, lists, tuples, and dicts, we can use **subscript notation** (square brackets) to access data at an index.\n",
|
|
"\n",
|
|
"- strings, lists, and tuples are indexed by integers, **starting at 0** for first item\n",
|
|
" - these sequence types also support accesing a range of items, known as **slicing**\n",
|
|
" - use **negative indexing** to start at the back of the sequence\n",
|
|
"- dicts are indexed by their keys\n",
|
|
"\n",
|
|
"> Note: sets are not indexed, so we cannot use subscript notation to access data elements."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 39,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[3, 5, 6, 3, 'dog', 'cat', False, 5, 'grapes']"
|
|
]
|
|
},
|
|
"execution_count": 39,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Remember what's in list_1\n",
|
|
"list_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 40,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"3"
|
|
]
|
|
},
|
|
"execution_count": 40,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Access the first item in a sequence\n",
|
|
"list_1[0]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 41,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"(3, 5, 6, 3, 'dog', 'cat', False, 5, 'grapes')"
|
|
]
|
|
},
|
|
"execution_count": 41,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Remember what's in tuple_1\n",
|
|
"tuple_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 42,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'grapes'"
|
|
]
|
|
},
|
|
"execution_count": 42,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Access the last item in a sequence\n",
|
|
"tuple_1[-1]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 43,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'an example that re-assigned the original string'"
|
|
]
|
|
},
|
|
"execution_count": 43,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Access a range of items in a sequence\n",
|
|
"simple_string_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 44,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'n'"
|
|
]
|
|
},
|
|
"execution_count": 44,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"simple_string_1[1]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 45,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'an ex'"
|
|
]
|
|
},
|
|
"execution_count": 45,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"simple_string_1[0:5]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 46,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"(5, 'grapes')"
|
|
]
|
|
},
|
|
"execution_count": 46,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Access a range of items in a sequence\n",
|
|
"tuple_1[-2:]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 47,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"['dog', 'cat', False, 5, 'grapes']"
|
|
]
|
|
},
|
|
"execution_count": 47,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Access a range of items in a sequence\n",
|
|
"list_1[4:]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 48,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{'name': 'Jane', 'age': 23, 'fav_foods': ['pizza', 'fruit', 'fish']}"
|
|
]
|
|
},
|
|
"execution_count": 48,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Rembember what's in dict_1\n",
|
|
"dict_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 49,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'Jane'"
|
|
]
|
|
},
|
|
"execution_count": 49,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Access an item in a dictionary\n",
|
|
"# {'name': 'Jane', 'age': 23, 'fav_foods': ['pizza', 'fruit', 'fish']}\n",
|
|
"dict_1[\"name\"]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Python Built-In Functions & Callables\n",
|
|
"\n",
|
|
"A **function** is a Python object that you can \"call\" to **perform an action** or compute and **return another object**. You call a function by placing parentheses to the right of the function name. Some functions allow you to pass **arguments** inside the parentheses (separating multiple arguments with a comma). Internal to the function, these arguments are treated like variables.\n",
|
|
"\n",
|
|
"Python has several useful built-in functions to help you work with different objects and/or your environment. Here is a small sample of them:\n",
|
|
"\n",
|
|
"- **`type(obj)`** to determine the type of an object\n",
|
|
"- **`isinstance(val, obj)`** to determine if `val` is an `obj`\n",
|
|
"- **`len(container)`** to determine how many items are in a container\n",
|
|
"- **`callable(obj)`** to determine if an object is callable\n",
|
|
"- **`sorted(container)`** to return a new list from a container, with the items sorted\n",
|
|
"- **`sum(container)`** to compute the sum of a container of numbers\n",
|
|
"- **`min(container)`** to determine the smallest item in a container\n",
|
|
"- **`max(container)`** to determine the largest item in a container\n",
|
|
"- **`abs(number)`** to determine the absolute value of a number\n",
|
|
"- **`repr(obj)`** to return a string representation of an object\n",
|
|
"\n",
|
|
"> Complete list of built-in functions: https://docs.python.org/3/library/functions.html\n",
|
|
"\n",
|
|
"There are also different ways of defining your own functions and callable objects that we will explore later."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 50,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"float"
|
|
]
|
|
},
|
|
"execution_count": 50,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the type() function to determine the type of an object\n",
|
|
"type(1.0)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 51,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"False"
|
|
]
|
|
},
|
|
"execution_count": 51,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"price = \"1.11\"\n",
|
|
"isinstance(price, float)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 52,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"3"
|
|
]
|
|
},
|
|
"execution_count": 52,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the len() function to determine how many items are in a container\n",
|
|
"len([1, 2, 3])"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 53,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"24"
|
|
]
|
|
},
|
|
"execution_count": 53,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the len() function to determine how many items are in a container\n",
|
|
"len(simple_string_2)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 54,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"False"
|
|
]
|
|
},
|
|
"execution_count": 54,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the callable() function to determine if an object is callable\n",
|
|
"callable(\"a\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 55,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"False"
|
|
]
|
|
},
|
|
"execution_count": 55,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the callable() function to determine if an object is callable\n",
|
|
"callable(dict_1)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 56,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[-3, 1, 2, 3.6, 5, 7, 10]"
|
|
]
|
|
},
|
|
"execution_count": 56,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the sorted() function to return a new list from a container, with the items sorted\n",
|
|
"sorted([10, 1, 3.6, 7, 5, 2, -3])"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 57,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"['a', 'j', 'n', 'o', 's']"
|
|
]
|
|
},
|
|
"execution_count": 57,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"sorted(\"jason\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 58,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"['California', 'Chicago', 'ants', 'cats', 'dogs', 'mice', 'zebras']"
|
|
]
|
|
},
|
|
"execution_count": 58,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the sorted() function to return a new list from a container, with the items sorted\n",
|
|
"# - notice that capitalized strings come first\n",
|
|
"sorted([\"dogs\", \"cats\", \"zebras\", \"Chicago\", \"California\", \"ants\", \"mice\"])"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 59,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"25.6"
|
|
]
|
|
},
|
|
"execution_count": 59,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the sum() function to compute the sum of a container of numbers\n",
|
|
"sum([10, 1, 3.6, 7, 5, 2, -3])"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 60,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"-3"
|
|
]
|
|
},
|
|
"execution_count": 60,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the min() function to determine the smallest item in a container\n",
|
|
"min([10, 1, 3.6, 7, 5, 2, -3])"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 61,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'a'"
|
|
]
|
|
},
|
|
"execution_count": 61,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the min() function to determine the smallest item in a container\n",
|
|
"min([\"g\", \"z\", \"a\", \"y\"])"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 62,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"10"
|
|
]
|
|
},
|
|
"execution_count": 62,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the max() function to determine the largest item in a container\n",
|
|
"max([10, 1, 3.6, 7, 5, 2, -3])"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 63,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'s'"
|
|
]
|
|
},
|
|
"execution_count": 63,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the max() function to determine the largest item in a container\n",
|
|
"max(\"gibberish\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 64,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"10"
|
|
]
|
|
},
|
|
"execution_count": 64,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the abs() function to determine the absolute value of a number\n",
|
|
"abs(10)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 65,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"12"
|
|
]
|
|
},
|
|
"execution_count": 65,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the abs() function to determine the absolute value of a number\n",
|
|
"abs(-12)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 66,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 66,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use the repr() function to return a string representation of an object\n",
|
|
"isinstance(repr(list_1), str)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Python Object Attributes (Methods & Properties)\n",
|
|
"\n",
|
|
"Different types of objects in Python have different **attributes** that can be referred to by name (similar to a variable). To access an attribute of an object, use a dot (`.`) after the object, then specify the attribute (i.e. `obj.attribute`)\n",
|
|
"\n",
|
|
"When an attribute of an object is a callable, that attribute is called a **method**. It is the same as a function, only this function is bound to a particular object.\n",
|
|
"\n",
|
|
"When an attribute of an object is not a callable, that attribute is called a **property**. It is just a piece of data about the object, that is itself another object.\n",
|
|
"\n",
|
|
"The built-in `dir()` function can be used to return a list of an object's attributes.\n",
|
|
"\n",
|
|
"<hr>"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Some Methods On `string` Objects\n",
|
|
"\n",
|
|
"- **`.capitalize()`** to return a capitalized version of the string (only first char uppercase)\n",
|
|
"- **`.upper()`** to return an uppercase version of the string (all chars uppercase)\n",
|
|
"- **`.lower()`** to return an lowercase version of the string (all chars lowercase)\n",
|
|
"- **`.count(substring)`** to return the number of occurences of the substring in the string\n",
|
|
"- **`.startswith(substring)`** to determine if the string starts with the substring\n",
|
|
"- **`.endswith(substring)`** to determine if the string ends with the substring\n",
|
|
"- **`.replace(old, new)`** to return a copy of the string with occurences of the \"old\" replaced by \"new\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 67,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Assign a string to a variable\n",
|
|
"a_string = \"tHis is a sTriNg\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 68,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'This is a string'"
|
|
]
|
|
},
|
|
"execution_count": 68,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Return a capitalized version of the string\n",
|
|
"a_string.capitalize()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 69,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'THIS IS A STRING'"
|
|
]
|
|
},
|
|
"execution_count": 69,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Return an uppercase version of the string\n",
|
|
"a_string.upper()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 70,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'this is a string'"
|
|
]
|
|
},
|
|
"execution_count": 70,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Return a lowercase version of the string\n",
|
|
"a_string.lower()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 71,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'tHis is a sTriNg'"
|
|
]
|
|
},
|
|
"execution_count": 71,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Notice that the methods called have not actually modified the string\n",
|
|
"a_string"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 72,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"3"
|
|
]
|
|
},
|
|
"execution_count": 72,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Count number of occurences of a substring in the string\n",
|
|
"a_string.count(\"i\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 73,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"1"
|
|
]
|
|
},
|
|
"execution_count": 73,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Count number of occurences of a substring in the string after a certain position\n",
|
|
"a_string.count(\"i\", 7)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 74,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"2"
|
|
]
|
|
},
|
|
"execution_count": 74,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Count number of occurences of a substring in the string\n",
|
|
"a_string.count(\"is\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 75,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"False"
|
|
]
|
|
},
|
|
"execution_count": 75,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Does the string start with 'this'?\n",
|
|
"a_string.startswith(\"this\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 76,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 76,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Does the lowercase string start with 'this'?\n",
|
|
"a_string.lower().startswith(\"this\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 77,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 77,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Does the string end with 'Ng'?\n",
|
|
"a_string.endswith(\"Ng\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 78,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'tHXYZ XYZ a sTriNg'"
|
|
]
|
|
},
|
|
"execution_count": 78,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Return a version of the string with a substring replaced with something else\n",
|
|
"a_string.replace(\"is\", \"XYZ\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 79,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'tH!s !s a sTr!Ng'"
|
|
]
|
|
},
|
|
"execution_count": 79,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Return a version of the string with a substring replaced with something else\n",
|
|
"a_string.replace(\"i\", \"!\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 80,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'tH!s !s a sTriNg'"
|
|
]
|
|
},
|
|
"execution_count": 80,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Return a version of the string with the first 2 occurences a substring replaced with something else\n",
|
|
"a_string.replace(\"i\", \"!\", 2)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {
|
|
"collapsed": true,
|
|
"jupyter": {
|
|
"outputs_hidden": true
|
|
}
|
|
},
|
|
"source": [
|
|
"## Some Methods On `list` Objects\n",
|
|
"\n",
|
|
"- **`.append(item)`** to add a single item to the list\n",
|
|
"- **`.extend([item1, item2, ...])`** to add multiple items to the list\n",
|
|
"- **`.remove(item)`** to remove a single item from the list\n",
|
|
"- **`.pop()`** to remove and return the item at the end of the list\n",
|
|
"- **`.pop(index)`** to remove and return an item at an index"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 81,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[3, 5, 6, 3, 'dog', 'cat', False, 5, 'grapes']"
|
|
]
|
|
},
|
|
"execution_count": 81,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Remember what's in list_1\n",
|
|
"list_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 82,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[3, 5, 6, 3, 'dog', 'cat', False, 5, 'grapes', 'basketball']"
|
|
]
|
|
},
|
|
"execution_count": 82,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# append a string to a list\n",
|
|
"list_1.append(\"basketball\")\n",
|
|
"list_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 83,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[3, 5, 6, 3, 'dog', 'cat', False, 5, 'grapes', 'basketball', 'baseball', 1]"
|
|
]
|
|
},
|
|
"execution_count": 83,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Add multiple items to a list\n",
|
|
"list_1.extend([\"baseball\", 1]) # equiv. list + list\n",
|
|
"list_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 84,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[3, 5, 6, 3, 'dog', False, 5, 'grapes', 'basketball', 'baseball', 1]"
|
|
]
|
|
},
|
|
"execution_count": 84,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Remove a sinle item from a list\n",
|
|
"list_1.remove(\"cat\")\n",
|
|
"list_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 85,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"1"
|
|
]
|
|
},
|
|
"execution_count": 85,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Remove the last item and return it\n",
|
|
"list_1.pop()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 86,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[3, 5, 6, 3, 'dog', False, 5, 'grapes', 'basketball', 'baseball']"
|
|
]
|
|
},
|
|
"execution_count": 86,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"list_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 87,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"3"
|
|
]
|
|
},
|
|
"execution_count": 87,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# remove an item at index 0 and return it\n",
|
|
"list_1.pop(0)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Some Methods On `set` Objects\n",
|
|
"\n",
|
|
"- **`.add(item)`** to add a single item to the set\n",
|
|
"- **`.update([item1, item2, ...])`** to add multiple items to the set\n",
|
|
"- **`.update(set_2, set3, ...)`** to add items from all provided sets to the set\n",
|
|
"- **`.remove(item)`** to remove a single item from the set\n",
|
|
"- **`.difference(set_2)`** to return items in the set that are not in another set\n",
|
|
"- **`.intersection(set_2)`** to return items in both sets\n",
|
|
"- **`.union(set_2)`** to return items that are in either set\n",
|
|
"- **`.symmetric_difference(set_2)`** to return items that are only in one set (not both)\n",
|
|
"- **`.issuperset(set_2)`** does the set contain everything in the other set?\n",
|
|
"- **`.issubset(set_2)`** is the set contained in the other set?"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 88,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{'Jason', 'jason'}"
|
|
]
|
|
},
|
|
"execution_count": 88,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"set([\"Jason\", \"jason\", \"jason\"])"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 89,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{3, 5, 6, False, 'cat', 'dog', 'fuzz'}"
|
|
]
|
|
},
|
|
"execution_count": 89,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"set_1.add(\"fuzz\")\n",
|
|
"set_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 90,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{3, 5, 6, False, 'cat', 'coke', 'dog', 'fuzz', 'pepsi'}"
|
|
]
|
|
},
|
|
"execution_count": 90,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"set_1.update([\"coke\", \"pepsi\"])\n",
|
|
"set_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 91,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{3,\n",
|
|
" 5,\n",
|
|
" 6,\n",
|
|
" False,\n",
|
|
" 'cat',\n",
|
|
" 'coke',\n",
|
|
" 'dog',\n",
|
|
" 'fuzz',\n",
|
|
" 'jane',\n",
|
|
" 'jason',\n",
|
|
" 'jaya',\n",
|
|
" 'john',\n",
|
|
" 'jukes',\n",
|
|
" 'pepsi'}"
|
|
]
|
|
},
|
|
"execution_count": 91,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"set_1.update(set_2)\n",
|
|
"set_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 92,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{3,\n",
|
|
" 5,\n",
|
|
" 6,\n",
|
|
" False,\n",
|
|
" 'coke',\n",
|
|
" 'dog',\n",
|
|
" 'fuzz',\n",
|
|
" 'jane',\n",
|
|
" 'jason',\n",
|
|
" 'jaya',\n",
|
|
" 'john',\n",
|
|
" 'jukes',\n",
|
|
" 'pepsi'}"
|
|
]
|
|
},
|
|
"execution_count": 92,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"set_1.remove(\"cat\")\n",
|
|
"set_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 93,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{3, 5, 6, False, 'coke', 'dog', 'fuzz', 'pepsi'}"
|
|
]
|
|
},
|
|
"execution_count": 93,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"set_1.difference(set_2)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 94,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{'jane', 'jason', 'jaya', 'john', 'jukes'}"
|
|
]
|
|
},
|
|
"execution_count": 94,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"set_1.intersection(set_2)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 95,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{3,\n",
|
|
" 5,\n",
|
|
" 6,\n",
|
|
" False,\n",
|
|
" 'coke',\n",
|
|
" 'dog',\n",
|
|
" 'fuzz',\n",
|
|
" 'jane',\n",
|
|
" 'jason',\n",
|
|
" 'jaya',\n",
|
|
" 'john',\n",
|
|
" 'jukes',\n",
|
|
" 'pepsi'}"
|
|
]
|
|
},
|
|
"execution_count": 95,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"set_1.union(set_2)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 96,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 96,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"set_1.issuperset(set_2)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 97,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"False"
|
|
]
|
|
},
|
|
"execution_count": 97,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"set_1.issubset(set_2)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Some Methods On `dict` Objects\n",
|
|
"\n",
|
|
"- **`.update([(key1, val1), (key2, val2), ...])`** to add multiple key-value pairs to the dict\n",
|
|
"- **`.update(dict_2)`** to add all keys and values from another dict to the dict\n",
|
|
"- **`.pop(key)`** to remove key and return its value from the dict (error if key not found)\n",
|
|
"- **`.pop(key, default_val)`** to remove key and return its value from the dict (or return default_val if key not found)\n",
|
|
"- **`.get(key)`** to return the value at a specified key in the dict (or None if key not found)\n",
|
|
"- **`.get(key, default_val)`** to return the value at a specified key in the dict (or default_val if key not found)\n",
|
|
"- **`.keys()`** to return a list of keys in the dict\n",
|
|
"- **`.values()`** to return a list of values in the dict\n",
|
|
"- **`.items()`** to return a list of key-value pairs (tuples) in the dict"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 98,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{'name': 'Jane', 'age': 23, 'fav_foods': ['pizza', 'fruit', 'fish']}"
|
|
]
|
|
},
|
|
"execution_count": 98,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Remember what's in dict_1\n",
|
|
"dict_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 99,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{'name': 'Jane',\n",
|
|
" 'age': 23,\n",
|
|
" 'fav_foods': ['pizza', 'fruit', 'fish'],\n",
|
|
" 'rain': True,\n",
|
|
" 'cars': 'a lot'}"
|
|
]
|
|
},
|
|
"execution_count": 99,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Update dict_1 with an iterable\n",
|
|
"dict_1.update([(\"rain\", True), (\"cars\", \"a lot\")])\n",
|
|
"dict_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 100,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{'name': 'Javier',\n",
|
|
" 'age': 45,\n",
|
|
" 'fav_foods': ['chicken', 'veg', 'candy'],\n",
|
|
" 'rain': True,\n",
|
|
" 'cars': 'a lot'}"
|
|
]
|
|
},
|
|
"execution_count": 100,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Update dict_1 with another dict\n",
|
|
"dict_1.update(dict_2)\n",
|
|
"dict_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 101,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"45"
|
|
]
|
|
},
|
|
"execution_count": 101,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Remove the key and value at age\n",
|
|
"dict_1.pop(\"age\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 102,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{'name': 'Javier',\n",
|
|
" 'fav_foods': ['chicken', 'veg', 'candy'],\n",
|
|
" 'rain': True,\n",
|
|
" 'cars': 'a lot'}"
|
|
]
|
|
},
|
|
"execution_count": 102,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Key and value are removed\n",
|
|
"dict_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 103,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"50"
|
|
]
|
|
},
|
|
"execution_count": 103,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use a default value\n",
|
|
"dict_1.pop(\"age\", 50)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 104,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'No car found'"
|
|
]
|
|
},
|
|
"execution_count": 104,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Use get to set a default\n",
|
|
"dict_1.get(\"car\", \"No car found\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 105,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"dict_keys(['name', 'fav_foods', 'rain', 'cars'])"
|
|
]
|
|
},
|
|
"execution_count": 105,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Get the keys of a dict as an iterable\n",
|
|
"dict_1.keys()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 106,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"dict_values(['Javier', ['chicken', 'veg', 'candy'], True, 'a lot'])"
|
|
]
|
|
},
|
|
"execution_count": 106,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Get the values of a dict as an iterable\n",
|
|
"dict_1.values()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 107,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"dict_items([('name', 'Javier'), ('fav_foods', ['chicken', 'veg', 'candy']), ('rain', True), ('cars', 'a lot')])"
|
|
]
|
|
},
|
|
"execution_count": 107,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Get the key-value pairs of a dict as an iterable\n",
|
|
"dict_1.items()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Positional Arguments & Keyword Arguments To Callables\n",
|
|
"\n",
|
|
"You can call a function/method in a number of different ways:\n",
|
|
"\n",
|
|
"- `func()`: Call `func` with no arguments\n",
|
|
"- `func(arg)`: Call `func` with one positional argument\n",
|
|
"- `func(arg1, arg2)`: Call `func` with two positional arguments\n",
|
|
"- `func(arg1, arg2, ..., argn)`: Call `func` with many positional arguments\n",
|
|
"- `func(kwarg=value)`: Call `func` with one keyword argument \n",
|
|
"- `func(kwarg1=value1, kwarg2=value2)`: Call `func` with two keyword arguments\n",
|
|
"- `func(kwarg1=value1, kwarg2=value2, ..., kwargn=valuen)`: Call `func` with many keyword arguments\n",
|
|
"- `func(arg1, arg2, kwarg1=value1, kwarg2=value2)`: Call `func` with positonal arguments and keyword arguments\n",
|
|
"- `obj.method()`: Same for `func`.. and every other `func` example\n",
|
|
"\n",
|
|
"When using **positional arguments**, you must provide them in the order that the function defined them (the function's **signature**).\n",
|
|
"\n",
|
|
"When using **keyword arguments**, you can provide the arguments you want, in any order you want, as long as you specify each argument's name.\n",
|
|
"\n",
|
|
"When using positional and keyword arguments, positional arguments must come first."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 108,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"def func_1():\n",
|
|
" return 1 + 1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 109,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"2"
|
|
]
|
|
},
|
|
"execution_count": 109,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"func_1()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 110,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"25"
|
|
]
|
|
},
|
|
"execution_count": 110,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"def func_2(x):\n",
|
|
" return x**2 # equiv. x^2\n",
|
|
"\n",
|
|
"\n",
|
|
"func_2(5)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 111,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"4.0"
|
|
]
|
|
},
|
|
"execution_count": 111,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"def func_3(x, y):\n",
|
|
" return x / y\n",
|
|
"\n",
|
|
"\n",
|
|
"func_3(8, 2)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 112,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"{'one': 1, 'two': 2, 'jason': 'banana'}\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"def func_4(**kwargs):\n",
|
|
" print(kwargs)\n",
|
|
"\n",
|
|
"\n",
|
|
"func_4(one=1, two=2, jason=\"banana\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 113,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"def func_5(a, b, c, **kwargs):\n",
|
|
" pass\n",
|
|
"\n",
|
|
"\n",
|
|
"func_5(2, 3, c=5)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Python \"for loops\"\n",
|
|
"\n",
|
|
"It is easy to **iterate** over a collection of items using a **for loop**. The strings, lists, tuples, sets, and dictionaries we defined are all **iterable** containers.\n",
|
|
"\n",
|
|
"The for loop will go through the specified container, one item at a time, and provide a temporary variable for the current item. You can use this temporary variable like a normal variable."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 114,
|
|
"metadata": {
|
|
"scrolled": true
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"5\n",
|
|
"6\n",
|
|
"3\n",
|
|
"dog\n",
|
|
"False\n",
|
|
"5\n",
|
|
"grapes\n",
|
|
"basketball\n",
|
|
"baseball\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"list_1\n",
|
|
"\n",
|
|
"for item in list_1:\n",
|
|
" print(item)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 115,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"3\n",
|
|
"5\n",
|
|
"6\n",
|
|
"3\n",
|
|
"dog\n",
|
|
"cat\n",
|
|
"False\n",
|
|
"5\n",
|
|
"grapes\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"for item in tuple_1:\n",
|
|
" print(item)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 116,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"False\n",
|
|
"3\n",
|
|
"5\n",
|
|
"6\n",
|
|
"john\n",
|
|
"jane\n",
|
|
"coke\n",
|
|
"jukes\n",
|
|
"jaya\n",
|
|
"jason\n",
|
|
"fuzz\n",
|
|
"pepsi\n",
|
|
"dog\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"for item in set_1:\n",
|
|
" print(item)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 117,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Key:name -> Value:Javier\n",
|
|
"Key:fav_foods -> Value:['chicken', 'veg', 'candy']\n",
|
|
"Key:rain -> Value:True\n",
|
|
"Key:cars -> Value:a lot\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"for key, value in dict_1.items():\n",
|
|
" print(f\"Key:{key} -> Value:{value}\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Python \"if statements\" & \"while loops\"\n",
|
|
"\n",
|
|
"Conditional expressions can be used with these two **conditional statements**.\n",
|
|
"\n",
|
|
"The **if statement** allows you to test a condition and perform some actions if the condition evaluates to `True`. You can also provide `elif` and/or `else` clauses to an if statement to take alternative actions if the condition evaluates to `False`.\n",
|
|
"\n",
|
|
"The **while loop** will keep looping until its conditional expression evaluates to `False`.\n",
|
|
"\n",
|
|
"> Note: It is possible to \"loop forever\" when using a while loop with a conditional expression that never evaluates to `False`.\n",
|
|
">\n",
|
|
"> Note: Since the **for loop** will iterate over a container of items until there are no more, there is no need to specify a \"stop looping\" condition."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 118,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Correct\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"if 1 < 2:\n",
|
|
" print(\"Correct\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 119,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 119,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"1 < 2"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 120,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Correct\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"if (1 < 2) and isinstance(\"jason\", str) and 1 and 12 < 20:\n",
|
|
" print(\"Correct\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 121,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Default\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"if 1 > 2:\n",
|
|
" print(\"Incorrect\")\n",
|
|
"elif 1 > 3:\n",
|
|
" print(\"Still incorrect\")\n",
|
|
"else:\n",
|
|
" print(\"Default\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## List Comprehensions"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 122,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[1, 2, 3, 4, 5]"
|
|
]
|
|
},
|
|
"execution_count": 122,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Create a simple list\n",
|
|
"l = [1, 2, 3, 4, 5]\n",
|
|
"l"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 123,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[1, 2, 3, 4, 5, 1, 2, 3, 4, 5]"
|
|
]
|
|
},
|
|
"execution_count": 123,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# This does not multiply each value by 2\n",
|
|
"l * 2"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 124,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# The long way to do it...\n",
|
|
"new_list = []\n",
|
|
"for item in l:\n",
|
|
" v = item * 2\n",
|
|
" new_list.append(v)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 125,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[2, 4, 6, 8, 10]"
|
|
]
|
|
},
|
|
"execution_count": 125,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"new_list"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 126,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[2, 4, 6, 8, 10]"
|
|
]
|
|
},
|
|
"execution_count": 126,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Same result using a list comprehension\n",
|
|
"[item * 2 for item in l]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 127,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[0.5, 1.0, 1.5, 2.0, 2.5]"
|
|
]
|
|
},
|
|
"execution_count": 127,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Another example\n",
|
|
"x = []\n",
|
|
"for i in [1, 2, 3, 4, 5]:\n",
|
|
" x.append(i / 2)\n",
|
|
"x"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 128,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[0.5, 1.0, 1.5, 2.0, 2.5]"
|
|
]
|
|
},
|
|
"execution_count": 128,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"[i / 2 for i in [1, 2, 3, 4, 5]]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 129,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"[int, int, int, str, bool, int, str, str, str]"
|
|
]
|
|
},
|
|
"execution_count": 129,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"[type(i) for i in list_1]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Importing Modules"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 130,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import math\n",
|
|
"import numpy"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 131,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"3.0"
|
|
]
|
|
},
|
|
"execution_count": 131,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"math.sqrt(9)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 132,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"3.0"
|
|
]
|
|
},
|
|
"execution_count": 132,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"numpy.sqrt(9)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 133,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import math as m"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 134,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"3.0"
|
|
]
|
|
},
|
|
"execution_count": 134,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"m.sqrt(9)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 135,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from math import sqrt\n",
|
|
"from numpy import sqrt"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 136,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"3.0"
|
|
]
|
|
},
|
|
"execution_count": 136,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"sqrt(9)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Exceptions"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 137,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "KeyError",
|
|
"evalue": "'food'",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)",
|
|
"Cell \u001b[0;32mIn[137], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m dict3 \u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mname\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mjason\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcar\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnope\u001b[39m\u001b[38;5;124m\"\u001b[39m}\n\u001b[0;32m----> 2\u001b[0m \u001b[43mdict3\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mfood\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\n",
|
|
"\u001b[0;31mKeyError\u001b[0m: 'food'"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"dict3 = {\"name\": \"jason\", \"car\": \"nope\"}\n",
|
|
"dict3[\"food\"]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 138,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "ZeroDivisionError",
|
|
"evalue": "division by zero",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
|
|
"Cell \u001b[0;32mIn[138], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;241;43m2\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m/\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\n",
|
|
"\u001b[0;31mZeroDivisionError\u001b[0m: division by zero"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"2 / 0"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 139,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "TypeError",
|
|
"evalue": "set expected at most 1 argument, got 3",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
|
|
"Cell \u001b[0;32mIn[139], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;43mset\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m3\u001b[39;49m\u001b[43m)\u001b[49m\n",
|
|
"\u001b[0;31mTypeError\u001b[0m: set expected at most 1 argument, got 3"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"set(1, 2, 3)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 140,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "NameError",
|
|
"evalue": "name 'jason' is not defined",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
|
|
"Cell \u001b[0;32mIn[140], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mjason\u001b[49m\n",
|
|
"\u001b[0;31mNameError\u001b[0m: name 'jason' is not defined"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"jason"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 141,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "SyntaxError",
|
|
"evalue": "invalid syntax (1125386000.py, line 1)",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;36m Cell \u001b[0;32mIn[141], line 1\u001b[0;36m\u001b[0m\n\u001b[0;31m 1 + 2:\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"1 + 2:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 150,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "Exception",
|
|
"evalue": "My own exception",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[0;31mException\u001b[0m Traceback (most recent call last)",
|
|
"Cell \u001b[0;32mIn[150], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mMy own exception\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
|
|
"\u001b[0;31mException\u001b[0m: My own exception"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"raise Exception(\"My own exception\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 151,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "AssertionError",
|
|
"evalue": "Pass a number >=0",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)",
|
|
"Cell \u001b[0;32mIn[151], line 6\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m x \u001b[38;5;241m>\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mPass a number >=0\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m math\u001b[38;5;241m.\u001b[39msqrt(x)\n\u001b[0;32m----> 6\u001b[0m \u001b[43mfcn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\n",
|
|
"Cell \u001b[0;32mIn[151], line 2\u001b[0m, in \u001b[0;36mfcn\u001b[0;34m(x)\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mfcn\u001b[39m(x):\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m x \u001b[38;5;241m>\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mPass a number >=0\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m math\u001b[38;5;241m.\u001b[39msqrt(x)\n",
|
|
"\u001b[0;31mAssertionError\u001b[0m: Pass a number >=0"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"def fcn(x):\n",
|
|
" assert x >= 0, \"Pass a number >=0\"\n",
|
|
" return math.sqrt(x)\n",
|
|
"\n",
|
|
"\n",
|
|
"fcn(-1)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 152,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "ModuleNotFoundError",
|
|
"evalue": "No module named 'my_module'",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
|
|
"Cell \u001b[0;32mIn[152], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mmy_module\u001b[39;00m\n",
|
|
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'my_module'"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"import my_module"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 153,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "NameError",
|
|
"evalue": "name 'calculate' is not defined",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
|
|
"Cell \u001b[0;32mIn[153], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mcalculate\u001b[49m(\u001b[38;5;241m5\u001b[39m, \u001b[38;5;241m5\u001b[39m)\n",
|
|
"\u001b[0;31mNameError\u001b[0m: name 'calculate' is not defined"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"calculate(5, 5)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 154,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "ValueError",
|
|
"evalue": "math domain error",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
|
|
"Cell \u001b[0;32mIn[154], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mmath\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msqrt\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\n",
|
|
"\u001b[0;31mValueError\u001b[0m: math domain error"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"math.sqrt(-1)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 155,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "AttributeError",
|
|
"evalue": "module 'math' has no attribute 'my_func'",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
|
|
"Cell \u001b[0;32mIn[155], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mmath\u001b[39;00m\n\u001b[0;32m----> 3\u001b[0m \u001b[43mmath\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmy_func\u001b[49m(\u001b[38;5;241m2\u001b[39m)\n",
|
|
"\u001b[0;31mAttributeError\u001b[0m: module 'math' has no attribute 'my_func'"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"import math\n",
|
|
"\n",
|
|
"math.my_func(2)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 156,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "AttributeError",
|
|
"evalue": "'str' object has no attribute 'my_func'",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
|
|
"Cell \u001b[0;32mIn[156], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mjason\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmy_func\u001b[49m()\n",
|
|
"\u001b[0;31mAttributeError\u001b[0m: 'str' object has no attribute 'my_func'"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"\"jason\".my_func()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Classes: Creating Your Own Objects"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 157,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"class JasonStrimpel:\n",
|
|
" pass\n",
|
|
"\n",
|
|
"\n",
|
|
"class ThisIsMyClass:\n",
|
|
" pass"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 158,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Define a new class called `Thing` that is derived from the base Python object\n",
|
|
"class Car(object):\n",
|
|
" color = \"red\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 159,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"__main__.Car"
|
|
]
|
|
},
|
|
"execution_count": 159,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Create \"instances\" of our new classes\n",
|
|
"a = Car()\n",
|
|
"b = Car()\n",
|
|
"c = Car()\n",
|
|
"\n",
|
|
"type(c)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 160,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'red'"
|
|
]
|
|
},
|
|
"execution_count": 160,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"c.color"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 161,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Interact with a DictThing instance just as you would a normal dictionary\n",
|
|
"# Define a new class called `DictThing` that is derived from the `dict` type\n",
|
|
"class DictThing(dict):\n",
|
|
" my_property = 'I am a \"DictThing\"'"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 162,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"d = DictThing()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 163,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{'name': 'Javier',\n",
|
|
" 'fav_foods': ['chicken', 'veg', 'candy'],\n",
|
|
" 'rain': True,\n",
|
|
" 'cars': 'a lot'}"
|
|
]
|
|
},
|
|
"execution_count": 163,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"dict_1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 164,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "AttributeError",
|
|
"evalue": "'dict' object has no attribute 'my_property'",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
|
|
"Cell \u001b[0;32mIn[164], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mdict_1\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmy_property\u001b[49m\n",
|
|
"\u001b[0;31mAttributeError\u001b[0m: 'dict' object has no attribute 'my_property'"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"dict_1.my_property"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 165,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"{'age': 13, 'fav_foods': ['pizza', 'sushi', 'pad thai', 'waffles'], 'fav_color': 'green'}\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"d.update(\n",
|
|
" {\n",
|
|
" \"age\": 13,\n",
|
|
" \"fav_foods\": [\"pizza\", \"sushi\", \"pad thai\", \"waffles\"],\n",
|
|
" \"fav_color\": \"green\",\n",
|
|
" }\n",
|
|
")\n",
|
|
"print(d)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 166,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"I am a \"DictThing\"\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"print(d.my_property)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Creating An Initializer Method For Classes"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 167,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"class Car:\n",
|
|
"\n",
|
|
" color = \"red\"\n",
|
|
"\n",
|
|
" def __init__(self):\n",
|
|
" print(f\"The car is going fast.\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 168,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"The car is going fast.\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"a = Car()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Defining Attributes & Methods"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 169,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"class Car:\n",
|
|
"\n",
|
|
" color = \"red\"\n",
|
|
"\n",
|
|
" def __init__(self):\n",
|
|
" print(f\"The car is going fast.\")\n",
|
|
"\n",
|
|
" def drive(self, how_fast):\n",
|
|
" return f\"The {self.color} car drives {how_fast} mph.\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 170,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"The car is going fast.\n",
|
|
"The car is going fast.\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"car_a = Car()\n",
|
|
"car_b = Car()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 171,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'red'"
|
|
]
|
|
},
|
|
"execution_count": 171,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"car_a.color"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 172,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'red'"
|
|
]
|
|
},
|
|
"execution_count": 172,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"car_b.color"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 173,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'The red car drives 55 mph.'"
|
|
]
|
|
},
|
|
"execution_count": 173,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"car_b.drive(55)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"# `self` - Setting Attributes & Methods"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 174,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"class Car:\n",
|
|
"\n",
|
|
" def __init__(self, color, make):\n",
|
|
" self.color = color\n",
|
|
" self.color_cap = color.upper()\n",
|
|
" self.make = make\n",
|
|
"\n",
|
|
" def mph_to_kph(self, mph):\n",
|
|
" return mph * 1.60934\n",
|
|
"\n",
|
|
" def drive(self, how_fast):\n",
|
|
" return f\"The {self.color} {self.make} drives {how_fast} mph.\"\n",
|
|
"\n",
|
|
" def drive_in_kph(self, how_fast):\n",
|
|
" kph = self.mph_to_kph(how_fast)\n",
|
|
" return f\"The {self.color} {self.make} drives {kph} kph.\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 175,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"car_a = Car(\"Black\", \"Tahoe\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 176,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'The Black Tahoe drives 88.5137 kph.'"
|
|
]
|
|
},
|
|
"execution_count": 176,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"car_a.drive_in_kph(55)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 177,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'The Black Audi drives 160.934 kph.'"
|
|
]
|
|
},
|
|
"execution_count": 177,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"car_b = Car(\"Black\", \"Audi\")\n",
|
|
"car_b.drive_in_kph(100)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3 (ipykernel)",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.12.5"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 4
|
|
}
|