Skip to main content

My own library, code name Mashiro.

Project description

Mashiro

呐,欢迎回到『さくら荘』

Shiina Mashiro

一成不变的日子,总觉得索然无味,但是,在夏天,捡了这只纯白色的猫,住进樱花庄后,我发现了,无聊的并不是时间,而是和平凡无奇的自己.

这是我的自用库——Mashiro。因为太懒了只好把几个常用的代码块做成函数打包发布.

用法

  1. webget(u, encoding='utf-8') 获取URL页面内容,返回字符串,可通过encoding指定编码. 自带随机UA.

  2. get(url, outfile) 下载URL内容到本地(bin). 返回bool. 自带随机UA.

  3. btw(a,b,string) 获取两个字符串之间的内容,返回list.

  4. mkdir(filepath) 新建文件夹,如果文件夹存在自动跳过.

  5. readJSON(file_path, encoding='utf-8') 读取JSON文件并加载为对象,可指定编码.

  6. debug(s,k) debug模式,用于显示变量内容(好像没什么用?).

  7. Sakurasou() 随机返回一句樱花庄语录.

写在最后

以上几个函数足以应付普通的爬虫任务. emmmmmmmm不知道要写什么巴拉巴拉巴拉

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mashiro-0.2.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mashiro-0.2.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file mashiro-0.2.0.tar.gz.

File metadata

  • Download URL: mashiro-0.2.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.3

File hashes

Hashes for mashiro-0.2.0.tar.gz
Algorithm Hash digest
SHA256 abbd37103c223b95d319a68781abde72eac20e8c847f90f0e9c21b335767d904
MD5 33a054718c5d879e5d2382d66b41e322
BLAKE2b-256 fbe123cbd3ea5ca172288b985b6680ce18b8a7f502366dcfb669ced5201e9b99

See more details on using hashes here.

File details

Details for the file mashiro-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mashiro-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.3

File hashes

Hashes for mashiro-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c37df33ba381fc38fb897e132f2bae33278a003adf9f2c65a861b1b4f73e7ac3
MD5 3ac11483254111050b65020be8ba5d05
BLAKE2b-256 a30fcbff1617b3c4ba898976885fe65e93c53f37040b569447ce1fd09b03b150

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page