{"id":26307442,"url":"https://github.com/iniself/noba","last_synced_at":"2025-05-12T23:22:43.565Z","repository":{"id":42181145,"uuid":"480050243","full_name":"iniself/noba","owner":"iniself","description":"Noba not only backtrader as a quantitative investment platform, but also visualized using bokeh, which can get richer plot effects. Additionally, Noba also provide 'Ioc Container', 'Event System', 'Database Abstraction Layer', 'Pipeline System' and more.","archived":false,"fork":false,"pushed_at":"2023-06-04T01:25:12.000Z","size":941,"stargazers_count":94,"open_issues_count":2,"forks_count":22,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-24T00:39:07.341Z","etag":null,"topics":["backtrader","bokeh","investment-analysis","quantitative-finance","quantitative-investment","quantitative-trading"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iniself.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.EN.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-10T14:57:52.000Z","updated_at":"2025-04-12T04:27:08.000Z","dependencies_parsed_at":"2023-02-09T02:16:42.122Z","dependency_job_id":null,"html_url":"https://github.com/iniself/noba","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iniself%2Fnoba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iniself%2Fnoba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iniself%2Fnoba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iniself%2Fnoba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iniself","download_url":"https://codeload.github.com/iniself/noba/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253838185,"owners_count":21972107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backtrader","bokeh","investment-analysis","quantitative-finance","quantitative-investment","quantitative-trading"],"created_at":"2025-03-15T10:14:49.156Z","updated_at":"2025-05-12T23:22:43.543Z","avatar_url":"https://github.com/iniself.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is Noba\n## Noba means not only backtrader :)\n\n**You can visit noba documentation for more information: [EN(coming soon)](#) | [中文](https://aui.photos/noba-doc/zh/)**\n\nThe core of Noba is an `ioc container`, through which you can create `BB` service, which based on [Backtrader](https://www.backtrader.com/)*(one quantitative backtest system)* and [Bokeh](https://bokeh.org/) *(use bokeh as the backend, Backtrader can get richer plot effects)*    *\\* BB service would like to thank [backtrader_plotting](https://github.com/verybadsoldier/backtrader_plotting) and [btplotting](https://github.com/happydasch/btplotting) for providing the main code for using bokeh as the backend for the backtrader*\n```python\nfrom noba import core\nbt =  core.make('bb')\n```\n\nOf course, you can also create your own services based container. Combined with **Pipeline System** and **Event System** (which can be created directly through containers), noba can enable your quantitative projects to work in a more engineering methods\n```python\nfrom noba import core\npipline =  core.make('pipeline')\ncleaned_data = pipline.via(\"handle\").send(raw_data).through([ChangeDataType, RepeatRowData, ExceptionData, MissingData]).then(lambda raw_data:raw_data)\n```\n\n```python\nfrom noba import core\nevent = core.make('event')\ndb_event = event.hub(['read_database_complete'])\ndb_event.watch('read_database_complete', lambda data:..., always=True)\n...\ndb_event.fire('read_database_complete')\n```\n\nMore importantly, Noba can create database service objects (dber) through containers. This is a **Database Abstraction Layer**. Through configuration files(one json file) and unified one set of APIs, you can operate the most common databases\n\n```python\nfrom noba import core\ndber =  core.make('db')\nstocks = db.table('daily').where('Open==3578.73').or_where('High==3652.46').set_index('Date').get_except('OpenInterest')\n```\n\n# Getting Started\n* Python \u003e= 3.6 is required.\n* Suggest using conda to manage virtual environments\n\n\n## Installation\n\n```bash\npip install noba\n# or\npip install git+https://github.com/iniself/noba\n```\n\n\n## Init noba project\n\n```bash\nmkdir your_noba_project\ncd your_noba_project\nnoba init\n```\n\n## Preparation\nHere you can do some project configuration and write your own service provider, and so on. Please refer to the **NOBA documentation** for details\n\n## Write strategy\n```bash\nvim main.py\n```\n\nOnly give **Live Mode** example, about **Normal Mode** and **Optstrategy Mode** pls refer to **NOBA documentation**\n* Add to cerebro as an analyzer **(Live Mode)**:\n  ```python\n  from noba import core\n    ...\n    ...\n  bt = core.make('bb')\n  cerebro = bt.Cerebro()\n  cerebro.addstrategy(MyStrategy)\n  cerebro.adddata(LiveDataStream()) # Note! Data is must Live Data\n  cerebro.addanalyzer(bt.analyzers.Live, force_plot_legend=True, autostart=True)\n  cerebro.run()\n  # cerebro.plot() # do not run this line unless your data is not real-time\n  ```\n\n* If you need to change the default port or share the plotting to public:\n\n  ```python\n  cerebro.addanalyzer(bt.analyzers.Live, address=\"localhost\", port=8889)\n  ```\n\n* Note! In Jupyter you can plut to a single browser tab with iplot=False:\n\n  ```python\n  cerebro.plot(plot, iplot=False)\n  ```\n\n# Demos\n\n\u003chttps://iniself.github.io/noba/\u003e\n\n# Contact us\nTelegram Channel: [Aui_Say](https://t.me/aui_say)\nDiscord Server: [Aui and Friends](https://discord.gg/dhp8uzKSfR)\n\n\n# Sponsoring\n\nIf you want to support the development of noba, consider to support this project.\n\n* ETH: 0x0275779f70179748C6fCe1Fe5D7638DfA7e3F986\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finiself%2Fnoba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finiself%2Fnoba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finiself%2Fnoba/lists"}