Giter Club home page Giter Club logo

zillionare / python-project-wizard Goto Github PK

View Code? Open in Web Editor NEW
119.0 119.0 96.0 1.05 MB

A tool for creating skeleton python project, built with popular develop tools and conform to best practice.

Home Page: https://zillionare.github.io/python-project-wizard/

License: BSD 3-Clause "New" or "Revised" License

Python 85.47% Smarty 2.80% Shell 11.73%
boilerplate boilerplate-template codecov cookiecutter cookiecutter-pypackage cookiecutter-template flake8 github-ci mkdocstrings poetry pre-commit-hooks python scaffold starter-kit startertemplate template tox

python-project-wizard's Introduction

终极猜想!底蓓离的成因分析

内容摘要:
这几天圈内都在传底蓓离什么的。作为严肃的量化自媒体,我们就不跟着吃这波瓜了。不过,我一直很关注技术指标的顶背离和底背离,一直在追问它的成因如何,以及如何预测。

底蓓离把我目光再次吸引到这个领域来,于是突然有了一个猜想。虽然我还没来得及完全证实它,但这个猜想,值得你锁定我的频道。...

发表于 2024-04-25 人气 934 点击阅读

机器学习(XgBoost)预测顶和底

内容摘要:
之前的文章中,我们对中证1000指数进行了顶和底的标注。这一篇我们将利用这份标注数据,实现机器学习预测顶和底,并探讨一些机器学习的原理。

我们选取的特征非常简单--上影线和WR(William's R)的一个变种。选取这两个因子,是基于东吴证券高子剑在2020年6月的一份研报:...

发表于 2024-04-23 人气 292 点击阅读

新国九条下,低波动因子重要性提升!

内容摘要:
_Robert (Bob) Haugen, 低波动因子之父。图片来自MarketWatch_




之前我们有一期文章介绍了**低换手率因子**。它的背后的原理是,要买在**无人问津处,藏器待时,最终卖在人声鼎沸时**。这是一种博弈逻辑。

今天介绍的**低波动因子**,...

发表于 2024-04-22 人气 198 点击阅读

Don't fly solo! 量化人如何使用AI工具

内容摘要:
在投资界,巴菲特与查理.芒格的神仙友谊,是他们财富神话之外的另一段传奇。巴菲特曾这样评价芒格:他用思想的力量拓展了我的视野,让我以火箭的速度,从猩猩进化到人类。

人生何幸能得到一知己。如果没有这样的机缘,在AI时代,至少我们做量化时,可以让AI来伴飞。

这篇文章,分享我用AI...

发表于 2024-04-19 人气 407 点击阅读

为了机器能学习,我标注了 2 万条行情数据

内容摘要:
芝加哥大学海德公园。芝大是经济学重镇,其学者开创了著名的芝加哥经济学派,共产生了 100 位诺奖、10 位菲尔兹奖、4 位图灵奖。今天量化人追逐的 **Alpha**, 最早就来自于 Michael Jessen 在芝大时的博士论文。

---

很多人对基于机器学习的量化策略很...

发表于 2024-04-18 人气 780 点击阅读

月亮和Pandas - Wes Mckinney的传奇故事

内容摘要:
正如死亡和税收不可避免,Pandas对量化人而言,也具有同样的地位 -- 每个人都不可避免地要与之打交道。而Wes Mckinney正是Pandas的创建者。Pandas是有史以来,最成功的Python库之一,以一已之力,开拓了Python的生存空间。

---

毛姆的《月亮和...

发表于 2024-04-10 人气 847 点击阅读

1赔10!中证1000应该这样抄底

内容摘要:


3月28日那篇文章分析了前一日的下跌为什么是可能预见的。这一篇文章,我将用坚实的统计数...

发表于 2024-04-08 人气 861 点击阅读

没能上热搜,但卡尼曼值得我们纪念

内容摘要:
3月27日,行为经济学的开山鼻祖丹尼尔.卡尼曼去世。作为行为经济学的一个分支,行为金融学在量化中的运用越来越广泛,并成功地解释了时序方向上价格波动的诸多原因。

卡尼曼的重要贡献是建立起了一套形式化方法,使得运用心理学来解释和预测经济行为的研究纳入了科学的轨道。

---

前一...

发表于 2024-04-01 人气 537 点击阅读

交割日魔咒?

内容摘要:
周日莫斯科的恐袭,让所有的A股交易者捏了一把汗,怕不是我A又要买单?果然,短短三日,沪指跌去1.8%,中证1000跌去5.89%,亏钱效应还是非常明显的。

痛定之后,留下几个复盘问题,首先是,下跌的原因是什么?当然,我们求解的方法,都是量化思路。

交割日魔咒?

关于下...

发表于 2024-03-27 人气 771 点击阅读

7因子模型,除了规模、市场、动量和价值,还有哪些?

内容摘要:
这篇文章的源起是有读者问,七因子模型除了规模、市场、动量和价值之外,还包括哪几个因子?就这个题目,正好介绍一下Fung & Hsieh的七因子模型。

七因子模型一般是指David Hsieh和William Fung于2004年在一篇题为《Hedge Fund Benchmar...

发表于 2024-03-26 人气 250 点击阅读

4k stars! 如何实现按拼音首字母查询证券代码?

内容摘要:
一个可能只有少数量化人才需要的功能 -- 按拼音首字母来查找证券。比如,当我们键入ZGPA时,就能搜索出中国平安,或者是它的代码。这是我们使用行情软件时常用的一个功能。

这个功能的关键是要实现汉字转拼音。有的数据源已经提供了这个查询。但不是所有的数据源都有这个功能。

---
...

发表于 2024-03-24 人气 767 点击阅读

提速100倍!QMT复权因子高效算法

内容摘要:
QMT的XtQuant库提供了量化研究所需要的数据。它在一些API设计上面向底层多一些,应用层在使用时,还往往需要进行一些包装,比如复权就是如此。

这篇文章介绍了将XtQuant的除权信息转换成常常的复权因子的高性能算法。与官方示例相比,速度快了100多倍。

---

!!!...

发表于 2024-03-10 人气 890 点击阅读

python-project-wizard's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-project-wizard's Issues

add package version to github workflow

Sometimes we need to get python package version from github workflow CI.

steps:
  - name: Set the value
    id: step_one
    run: |
      echo "action_state=yellow" >> $GITHUB_ENV
  - name: Use the value
    id: step_two
    run: |
      echo "${{ env.action_state }}" # This will output 'yellow'

ModuleNotFoundError: No module named 'pkg_resources'

  • Date you used Cookiecutter PyPackage:
  • Cookiecutter version used, if any:
  • Python version, if any:
  • Operating System:

Description

ModuleNotFoundError: No module named 'pkg_resources'

What I Did

Paste the command(s) you ran and the output.

add .docstring.tpl to project

vscode extension autoDocstring has been installed more than 2.2M. Since ppw provide mkdocs, mkdocstrings, it should suggest this extension to user and provide the template.

Changelog generator failed

while running generate change log step of workflow 'release & publish', it failed to
generator change log if 0.1.0 doesn't exist.

By default we don't specify since_tag for user, however, the action seems specify 0.1.0
by default, which cause the problem.

the actions:

      - name: generate change log
        uses: heinrichreimer/[email protected]
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          issues: true
          issuesWoLabels: true
          pullRequests: true
          prWoLabels: true
          unreleased: true
          # no scineTag here by default. User should add and change at each release
          addSections: '{"documentation":{"prefix":"**Documentation:**","labels":["documentation"]}}'
          output: CHANGELOG.md

call stack:

/usr/local/bundle/gems/github_changelog_generator-1.15.0/lib/github_changelog_generator/generator/generator_tags.rb:138:in `filter_since_tag': Error: can't find tag 0, specified with --since-tag option. (GitHubChangelogGenerator::ChangelogGeneratorError)
	from /usr/local/bundle/gems/github_changelog_generator-1.15.0/lib/github_changelog_generator/generator/generator_tags.rb:120:in `get_filtered_tags'
	from /usr/local/bundle/gems/github_changelog_generator-1.15.0/lib/github_changelog_generator/generator/generator_tags.rb:15:in `fetch_and_filter_tags'
	from /usr/local/bundle/gems/github_changelog_generator-1.15.0/lib/github_changelog_generator/generator/generator.rb:46:in `compound_changelog'
	from /usr/local/bundle/gems/github_changelog_generator-1.15.0/lib/github_changelog_generator.rb:35:in `run'
	from /usr/local/bundle/gems/github_changelog_generator-1.15.0/bin/github_changelog_generator:5:in `<top (required)>'
	from /usr/local/bundle/bin/github_changelog_generator:23:in `load'
	from /usr/local/bundle/bin/github_changelog_generator:23:in `<main>'
Fetching tags... 100/100

CI doesn't support 3.10

when use python 3.10, at

        with:
          python-version: ${{ matrix.python-versions }}

3.10 is recognized as 3.1 thus the action failed

mkdocs colour toggle option

  • Date you used Cookiecutter PyPackage: 15/6/21
  • Python version, if any: 3.7
  • Operating System: Ubuntu

Description

Hi I was trying to setup a dark mode light mode toogle as per the mkdocs documentation so I basically replaced the following in mkdocs.yml

   palette:
     primary: light blue

with this

  palette:
    - scheme: default
      primary: indigo
      accent: indigo
      toggle:
        icon: material/toggle-switch-off-outline
        name: Switch to dark mode
    - scheme: slate
      primary: red
      accent: red
      toggle:
        icon: material/toggle-switch
        name: Switch to light mode

However, this doesn't work and the toggle is not displayed. Do you have an idea as to why this happens?

ppw init_dev failed

version 1.3.2

exception:

  EnvCommandError

  Command ['/home/aaron/miniconda3/envs/cheese/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/home/aaron/miniconda3/envs/cheese', '--no-deps', '/home/aaron/.cache/pypoetry/artifacts/a5/c6/8e/787aeae2abb2e89ea98a95e4a3122303096e22cdb2a47ef6a483e106d1/fire-0.4.0.tar.gz'] errored with the following return code 1, and output: 
  Processing /home/aaron/.cache/pypoetry/artifacts/a5/c6/8e/787aeae2abb2e89ea98a95e4a3122303096e22cdb2a47ef6a483e106d1/fire-0.4.0.tar.gz
    Installing build dependencies: started
    Installing build dependencies: finished with status 'error'
    error: subprocess-exited-with-error
    
    × pip subprocess to install build dependencies did not run successfully.
    │ exit code: 1
    ╰─> [2 lines of output]
        ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
        ERROR: No matching distribution found for setuptools>=40.8.0
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  

  at ~/miniconda3/envs/cheese/lib/python3.8/site-packages/poetry/utils/env.py:1540 in _run
      1536│                 output = subprocess.check_output(
      1537│                     command, stderr=subprocess.STDOUT, env=env, **kwargs
      1538│                 )
      1539│         except CalledProcessError as e:
    → 1540│             raise EnvCommandError(e, input=input_)
      1541│ 
      1542│         return decode(output)
      1543│ 
      1544│     def execute(self, bin: str, *args: str, **kwargs: Any) -> int:

The following error occurred when trying to handle this error:


  PoetryException

  Failed to install /home/aaron/.cache/pypoetry/artifacts/a5/c6/8e/787aeae2abb2e89ea98a95e4a3122303096e22cdb2a47ef6a483e106d1/fire-0.4.0.tar.gz

  at ~/miniconda3/envs/cheese/lib/python3.8/site-packages/poetry/utils/pip.py:58 in pip_install
       54│ 
       55│     try:
       56│         return environment.run_pip(*args)
       57│     except EnvCommandError as e:
    →  58│         raise PoetryException(f"Failed to install {path.as_posix()}") from e

seems it's python-fire's issue

Unittest support

Multiple issues with this cookiecutter

1- using unittest is not supported, tox command is using pytest regardless.
2- dev requirements placed into installation requirements

add email notification upon build success

add email notification when build success, using 'dawidd6/action-send-mail@v3'

this action requires the following secrets to be configured:

gh secret set BUILD_NOTIFY_MAIL_SERVER --body $BUILD_NOTIFY_MAIL_SERVER
gh secret set BUILD_NOTIFY_MAIL_FROM --body $BUILD_NOTIFY_MAIL_FROM
gh secret set BUILD_NOTIFY_MAIL_PASSWORD --body $BUILD_NOTIFY_MAIL_PASSWORD
gh secret set BUILD_NOTIFY_MAIL_RCPT --body $BUILD_NOTIFY_MAIL_RCPT

gh is a tool created by github

start github dev CI on every push

1.1 only enables github dev CI on limited branches, for example, master, release, main. However, dev CI should be enabled by default on all branches.

update codespell to latest version

codespell v1.16.0 can cause the following issue when python == 3.8:

RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode

upgrade to 2.2 could solve the problem

doc: toc baselevel should start with 2

according to HTML's spec, each document should have only one H1/Article, so your markdown should contains only on '#' and toc should started with '2'.

How to import modules in CookieCutter's style?

  • Date you used Cookiecutter PyPackage:today
  • Cookiecutter version used, if any:2.1.1
  • Python version, if any:3.9
  • Operating System:Windows11

Description

I want to develop something with ppw,however I can't import modules which is named to {{…}} in intellij idea with python plugin.
图片
how to solve this problem?

What I Did

Paste the command(s) you ran and the output.

let tox to install package under testing by poetry

now tox in ppw will install package under testing by itself, using pip, this will somehow cause dep resolving again. Since poetry is introduced, it's better to let poetry do the chores and tox should depends on poetry to create the testing env.

project_slug.py can cause circle import issue

the main entry point created by ppw before was {{project_slug}}.py, however, sometimes cause circular import issue by:

from {{project_slug}} import {{project_slug}}

change {{poject_slug}}.py to app.py

Support for fast-forwarding with Cruft

Hi,

This looks like a neat offshoot of cookiecutter! I'm wondering if you would consider integrating the capabilities of cruft into the ppw package?

cruft works by fast-forwarding projects from cookiecutter templates to reflect upstream changes in the template, i.e.: if the boilerplate has advanced and added features, cruft will apply those changes (to the best of its ability; will generate diff files otherwise).

A feature based on this would be a neat way of differentiating/empowering ppw (e.g. $ ppw fast-forward <local-clone>).

config repo secrets by script

it's tedious to config repo's secrets, especially when you have many to be configured. This should be automated by scripts -- using github cli gh.

merge test, dev and doc into one

currently ppw seperate extra dependency into test, dev and doc. Poetry prefer to using dev alone and it could be best practice

broken url of history

url in mail notification " please check change history at https://..." is wrong, it should contains version number, otherwise, it'll reach 404 page

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.