程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Reorganize 37 super Python libraries, and use 6 to count you

編輯:Python

It was used 2 Weeks to sort out Python All website development libraries in ( Hereinafter referred to as" :Web frame ), For your reference .

Q:Web What is the framework ?

A:Web The framework is mainly used for website development . Developers are building on Web The framework implements its own business logic .Web The framework implements many functions , It provides a set of general methods for realizing business logic .

Q:Web What does the framework do ?

A: Use Web frame , Many functions outside the business logic do not need to be improved by themselves , Instead, you can use the existing functions of the framework .Web The framework makes it possible to When developing websites , Reduced workload .

Q: Why do we use it Web frame ?

A:Web The framework is mainly used for website development , It can realize the interaction of data and the improvement of business functions . Use Web Framework for When developing websites , Data caching in progress 、 Database access 、 Data security verification, etc , You don't need to re implement it yourself , Instead, write the code related to business logic into the framework .

The library sort is According to the number of users and the activity of documents For reference ,** It is recommended that you use the top ranked framework , Because they are more fully documented , Technology accumulation should be more , The community is more prosperous , Get better support ,** In this way, when you encounter problems you can't solve , Solutions that can be found faster and more efficiently .

1. Django frame

Officer, network :

https://github.com/django/django.git

optimal spot : It's a high level Python Web Development framework , It is characterized by rapid development 、 Less code 、 High scalability .Django use MTV(Model、Template、View) Model organization resources , The framework has rich functions , The template extension can be selected at most . For professionals ,Django Be worthy of Python Number one Web Development framework .

Lack of spot : Including some functional modules that are not required by lightweight applications , Not as good as Flask Light . Over encapsulating many classes and methods , It's easier to use it directly , But it's hard to change . Compared with C,C++ performance ,Djang Low performance . The template realizes the complete separation of code and style , It is not allowed to appear in the template Python Code , Not enough flexibility . In addition, the learning curve is also relatively steep .

2. Flask frame

Officer, network :

https://flask.palletsprojects.com/en/2.0.x/

optimal spot :Flask It's a Python Web Developed micro framework , Strictly speaking , It only provides Web Server support , Does not provide full stack development support . However ,Flask Very light weight 、 It's simple , Build... Based on it Web The system counts in minutes , It is especially suitable for the development of small and micro prototype system . Spend less time 、 Generate available systems , It's a very cost-effective choice .

Lack of spot : For large website development , You need to design the rules of routing mapping , Otherwise, it will lead to code confusion . For beginners , Easy to create with low-quality code “ Bad web Applications ”.

3. Pyramid frame

Officer, network :

https://trypyramid.com/

optimal spot : It is a highly scalable and flexible Python Web Development framework . It's easy to get started , It is more suitable for medium-sized scenes that are designed while developing .Pyramid Does not provide an absolutely strict Framework Definition , The development can be expanded according to the requirements , Very friendly to high-level programmers .

Lack of spot : Not well known in China , Advanced usage requires inspiration from reading the source code . By default Chameleon Templates , Flexibility is not a factor .

4. web.py frame

Officer, network :

https://webpy.org/

optimal spot : As its name suggests ,web.py Is an adoption Python As a development language Web frame , Simple and powerful . Russia ranks first Yandex Search engines are developed based on this framework ,Guido van Rossum Think this is the best Python Web frame , Do you need to say anything else ? There are facts to testify 、 There is Daniel's approval , To use! !

Lack of spot :Web.py Not as consistent with... As other frameworks Python 3 Latest state of compatibility . This not only means a lack of support for asynchronous Syntax , It also means missing errors for deprecated functions . Besides , It is unclear whether defenders have plans to Python 2 Maintain... After reaching the end of its support life cycle Web.py Latest status of .

5. Tornado frame

Officer, network :

https://www.tornadoweb.org/en/stable/

optimal spot :Tornado It is based on asynchronous network function library Web Development framework , therefore , It can support tens of thousands of open connections ,Web Efficient and stable service . so ,Tornado Suitable for high concurrency scenarios Web System , The development process needs to adopt Tornado The framework provided , Poor flexibility , It's not too late to consider using it after determining the scenario .

Lack of spot :Tornado 5.0 Improved communication with Python Integration of native asynchronous functions . So... Is no longer supported Python 3.3, also Python 3.5 Users must use Python 3.5.2 Or later .Tornado 6.0 Will need Python 3.5 And higher , And will give up completely Python 2 Support .

6. TurboGears frame

Officer, network :

https://www.turbogears.org/

optimal spot :TurboGears The latest version Attempt to resolve TurboGears Original version 、Django、Rails And other frame defects , It supports multiple databases 、JavaScript Toolset 、 Various data exchange formats, etc , Of course , Its development is very efficient , It's very scalable . How does it relate to Django Which is better? ? It's hard to say ,Django The community is more active and perhaps more important .

Lack of spot :TurboGears Some of the disadvantages of include the basic management function , Fewer third-party applications and only rudimentary documentation .TurboGears A major challenge is its overwhelming . Because other components of it provide unlimited flexibility , When trying to decide which path to complete a task, it is too complex .

7. CherryPy frame

Officer, network :

https://cherrypy.org/

optimal spot :CherryPy It enables developers to develop according to the similar design methods of other object-oriented programs Web System , Then use the least code 、 The simplest way .CherryPy It's been developed 10 years , Good stability , Very suitable for small-scale Web Systematic and pure Python The programmer . What do you feel ?Python It has the potential to unify the Jianghu ! Rub one's eyes and wait .

Lack of spot : Contains only web The page provides a small amount of content required for the service , It should make people feel as if it doesn't look like “web frame ”, But like any other type of Python The application is the same .CherryPy The contained bits are used as low-level building blocks . Including session identifier and cookie Handle , But does not include HTML Templates . image Bottle equally ,CherryPy A method of mapping routes to directories on disk for static file service is provided .

8. Falcon frame

Officer, network :

http://falconframework.org/

optimal spot :Falcon It supports large-scale micro services API Or move App Back end response Web Development framework , It's based entirely on Python And provides very high performance 、 Reliability and scalability .Falcon Unique positioning and distinctive features , about App developer , Back end system construction may consider Falcon, Nine times out of ten, you won't regret it .

Lack of spot :Falcon The disadvantage is that there are a little too few packaging modules , There's a route , middleware , hook , In addition, there are no other functions ( Bare shell ). Additional features , For example, verification requires developers to develop extensions . Because its design assumes that it is used to build REST API.

9. Asgineer frame

Officer, network :

https://asgineer.readthedocs.io/

optimal spot :Asgineer Is a way to write asynchronous Web Application tools , Use as little abstraction as possible , While still providing friendly API. Just a few minutes to read the guide and reference materials ! stay Uvicorn Up operation Asgineer when , It is the fastest available Web One of the frames . It supports http Long polling 、 Server side events (SSE) and websockets. And with the right ( And fast ) A utility that provides services to assets in a way .

Lack of spot : Lack of Chinese documents .

10. Bottle frame

Officer, network :

https://bottlepy.org/docs/dev/

optimal spot :Bottle Is a Python Fast 、 Simple and lightweight WSGI Micro network framework . It is distributed as a single file module , except Python There are no dependencies outside the standard library . Support clean and dynamic URL. Fast and Pythonic Built in template engine , Support mako、jinja2 and cheetah Templates . Easy access to form data 、 Upload files 、cookie、 Titles and others are related to HTTP Related metadata .

Lack of spot :Bottle One consequence of minimalism is that some functions don't exist at all . Form validation is not supported , Include CSRF Protection and other functions . If you want to build a high degree of user interaction Web Applications , You need to add them yourself .

11. Emmett frame

Officer, network :

https://emmett.sh/

optimal spot : Write elegant code , Focus on your products , You should spend more time on your product than the underlying framework .Emmett It's the inventor's framework , Because it's designed to simplify your development process , Its grammar is simple 、 Easy to learn and understand . Don't waste time between routers and uncomfortable modes : Every time you write a route for an application , Everything is clearly in front of you .

Lack of spot : Lack of Chinese documents .

12. apidaora frame

Officer, network :

https://github.com/dutradda/apidaora

optimal spot : Use type annotations to request / The response is declared as a data class and Dictionary , Use jsondaora Verify the input data , One of the fastest python api One of the frames , Can be in any asgi Running on the server .

Lack of spot : Lack of Chinese documents .

13. Quixote frame

Officer, network :

http://www.quixote.ca/

optimal spot :Quixote It's a use Python Based on Web The framework of the application . Its goal is to achieve flexibility and high performance in this order .Quixote The structure of an application is often similar to that of a traditional application . The logic for formatting a web page consists of Python Classes and functions .Quixote Do not force separation of presentation logic and “ Back end ” Logic . contrary , We encourage you to use traditional technology . for example , A solution that puts its own logic in a package .

Lack of spot : although Quixote Be actively maintained , But the release frequency is low . The focus of recent development is to fix errors 、 Improve standard compliance and increase Quixote The flexibility of the .

14. reahl frame

Officer, network :

https://www.reahl.org/

optimal spot :reahl It is a tool that can be used by developers completely Python Language writing Web Open framework for application , use Python Being the only development language is its biggest feature . Besides ,reahl Provides a fairly clear and concise development framework , For developing general functionality Web The system is clear enough and feasible .

Lack of spot : When providing abstract vocabulary , Unable to master some more advanced user interface effects , At present, it is not allowed to use Sass structure Bootstrap Modified version of , And support more advanced user interface mode

15. hug frame

Officer, network :

https://hug.rest/

optimal spot :Hug It's a Python 3 API Development framework . It is designed so that software engineers can develop API, Then use it when you need it .Hug The framework simplifies... By providing various interfaces API Development . That's why the framework is called Python 3 The main reason for one of the fastest frames in .

Lack of spot : It uses the old WSGI standard , This is a synchronization framework , So it can't handle things like WebSockets And other asynchronous requests , Anyway? , It still has very good performance .

16. BlackSheep frame

Officer, network :

https://github.com/Neoteroi/BlackSheep

optimal spot :BlackSheep It's an asynchronous Web frame , For the use of Python Build event based Web Applications . It's inspired by Flask、ASP.NET Core and Yury Selivanov The job of .

Lack of spot : Lack of Chinese documents .

17. Index.py frame

Officer, network :

https://index-py.aber.sh/stable/

optimal spot : Realized ASGI3 Interface and use Radix Tree Route lookup . It's the fastest Python web One of the frames . All features serve the rapid development of high-performance Web service . A large number of correct type comments , Flexible and efficient routing system , visualization API Interface and online debugging , Support Server-sent events And WebSocket, Built in one click deployment command ( be based on uvicorn And gunicorn), Any available ASGI ecology .

Lack of spot :Index.py No built-in database 、 Cache and other functions . For those who have difficulty in choosing, please use Django.

18. Sanic frame

Officer, network :

https://github.com/sanic-org/sanic

optimal spot :Sanic It's a Python 3.7+ web The server and web frame , It's written very fast . It allows the use of Python 3.5 Added in async/await grammar , This makes your code non blocking and fast . The goal of the project is to provide a simple way to start and run a high-performance HTTP The server , The server is easy to build 、 Expansion and final expansion .

Lack of spot : In terms of function Sanic imitation Flask, For example, by sharing Blueprints The concept of , Tiny sub applications , Allow developers to split their code in larger organizations . For data addition, deletion, modification and query CRUD application ,Sanic Not a good choice .

19. Starlette frame

Officer, network :

https://pypi.org/project/starlette/

optimal spot :Starlette It's a lightweight ASGI frame / tool kit , Ideal for building performance asynchronous Services , It is production ready , And provide you with the following : Impressive performance .WwbSocket Support .GraphQL Support . In process background tasks . Start and stop events . Client based test build .CORS、GZip、 Static files 、 Flow response . Conversation and Cookie Support .100% Test coverage of .100% Type annotation code base . Zero hard dependency .

Lack of spot :Starlette All basic Web Micro framework function . But it doesn't provide automatic data validation , Serialize or API file .

20. Fastapi frame

Officer, network :

https://fastapi.tiangolo.com/

optimal spot :FastAPI It's a modern 、 Fast ( High performance ) Of Web frame , For standards based Python Type prompt use Python 3.6+ structure API. Very high performance , And NodeJS and Go Quite a ( thank Starlette and Pydantic). The fastest available Python One of the frames . The reduction is about 40% Of people ( Developer ) Error caused . brief , Simple , intuitive , robust .

Lack of spot : No template syntax in itself , Template syntax needs to be installed

21. Responder frame

Officer, network :

https://python-responder.org/

optimal spot : yes kennethreitz A newly developed project , It's based on Python Of HTTP Service Framework . The bottom layer uses Starlette Framework ,Starlette It's a lightweight model ASGI frame / tool kit , It can be used Starlette Build high-performance asynchronous systems IO service . be relative to Starlette , responder Be more developer friendly .kennethreitz Yes requests It's called “HTTP for Humans” Better understand this . In fact, by comparison ,responder Is better than Starlette Much more elegant .

Lack of spot : It could be a new project , The packing is not perfect . As far as the current version is concerned , A little code doesn't work yet . But the interface form has been defined , I hope that later versions will add .

22. Molten frame

Officer, network :

https://moltenframework.com/

optimal spot :Molten It's the smallest 、 Extensible 、 Fast and efficient framework , For the use of Python structure HTTP API. Schedule automatic validation requests , Code is easier to maintain . Instances can be serialized automatically , contain API Various functions usually required in the real world , Widely used PEP484 Type tips and mypy.

Lack of spot : It doesn't use third-party libraries like ( Such as Pydantic) Provide data validation , Serialization and documentation , It has its own library . therefore , These data type definitions will not be easy to reuse . The dependency injection system needs to pre register the dependency , And it will solve the dependency problem based on the declared type . therefore , It is not possible to declare multiple components to provide a specific type .

23. Clastic frame

Officer, network :

https://github.com/mahmoud/clastic

optimal spot : A powerful Python Web frame , Simplifies explicit development practices , At the same time, the global state is eliminated .Clastic It's all for Python language-written , Enhance reusability and testability , Take the initiative URL Routing check , Better control of application initialization , Improved middleware paradigm , No global state ,ORM usage , It's easier WSGI Integrate .

Lack of spot :Clastic No global state built ;URL Routing rule parameter and view function signature do not match , stay Clastic in , This mismatch will throw an exception when building the application .

24. Aiohttp frame

Officer, network :

https://docs.aiohttp.org/en/stable/

optimal spot : be used for asyncio and Python The asynchronous HTTP client / The server . Support for clients and HTTP The server , Support out of the box servers WebSockets And the client WebSockets, There is no call back to hell .Web The server has middleware 、 Signals and pluggable routes .

Lack of spot : according to RFC 7231 aiohttp 2.0 Accepted after version HEAD Requested adjustment , Use the previous version and use add_ get () Please add

seek , If you use HEAD Method access will return 405. If the processor will write a lot of response body content , You can perform HEAD Method to skip processing the content of the response body to improve execution efficiency .

25. Masonite frame

Officer, network :

https://docs.masoniteproject.com/

optimal spot : Modern and developer centric Python Web The framework aims to achieve practical batteries, Including developer tools with many out of the box features , With an extremely scalable architecture .Masonite Very suitable for beginners and developers to enter their first Web Applications , And the need to make full use of Masonite Experienced developers with the full potential to complete their applications .Masonite Strive to achieve fast and simple from installation to deployment , Therefore, developers can move from concept to creation as quickly and effectively as possible . Use it for your next SaaS! Try it once , You'll fall in love .

Lack of spot : about Masonite Come on , maximal ” competitors ” yes Django, Because the community is doing its best to make the framework easier , The next great thing to be happy . And Django comparison ,Masonite Still a baby , Look forward to its future performance .

26. Quart frame

Officer, network :

https://pgjones.gitlab.io/quart/

optimal spot :Quart It's a Python Network micro framework . Use Quart, You can present and provide HTML Templates , To write (RESTful)JSON API, service WebSockets, Stream request and response data , Almost through HTTP or WebSocket Agreement to do anything .

Lack of spot : It only supports Python 3.7+.

27. Tonberry frame

Officer, network :

https://github.com/Ayehavgunne/Tonberry

optimal spot : A meet ASGI Of Web Microframets , Adopt class based routing method . suffer CherryPy But with asyncio compatible . A group called Qactuar A complete set of ASGI The server is generated from this ongoing project .

Lack of spot : Using pull request , Please use the automatic formatter iSort and Black And use MyPy Verification code . This is without eliminating certain types of errors , It is not always possible to make MyPy Completely satisfied , But at least do your best and use comments carefully `# type: ignore`. Last , Try , Provide the most accurate type prompt possible .

28. cyclone frame

Officer, network :

https://cyclone.io/

optimal spot :Cyclone yes Python Of Web Server framework , It will Tornado API Implemented as a Twisted agreement .Twisted It's an event driven Python Network programming framework . It is the most mature non blocking I/O One of the Libraries , Available for public use .Tornado yes FriendFeed Open source version of web server , It's the most popular and fastest Python One of the network servers , Has a very good for building web applications API. In addition to the rich feature set ,Cyclone And solved C10K problem .

Lack of spot :Cyclone No longer supported python 2.x .

29. Klein frame

Officer, network :

https://github.com/twisted/klein

optimal spot :Klein It's a micro framework , For the use of Python Develop... That can be used in production Web service . It is “ tiny ” Of , Because it has something like Bottle and Flask Very small API. It is not “ tiny ”, Because it depends on something outside the standard library . This is mainly because it is based on widely used and well tested components , Such as Werkzeug and Twisted.

Lack of spot : Maybe it's a little out of date .

30. nameko frame

Officer, network :

https://github.com/nameko/nameko

optimal spot :AMQP RPC And events ( Release - subscribe ),HTTPGET、POST and websockets,CLI Realize simple and rapid development , Utilities for unit and integration testing .

Lack of spot :nameko The micro service will not automatically print the error log when there is an error , Need to add monitoring related dependencies , Computing intensive tasks cause tasks to retry .

31. CubicWeb frame

Officer, network :

https://www.cubicweb.org/

optimal spot :CubicWeb Is a kind of semantic Web Application framework , stay LGPL Get permission under , It enables developers to reuse components ( It's called a cube ) And follow the well-known object-oriented design principles to effectively build Web Applications . Reusable components that meet common requirements ( Data models and views ) library ,Python The power and flexibility of programming language , Used to store back-end data SQL database 、LDAP Catalog 、Subversion and Mercurial The reliability of the .

Lack of spot : To be in CubicWeb Get or manipulate persistent data in an application , You can use relational query language (RQL),RQL Provides a highly separate path to correlate various data sources . however , With its implementation , By manually building the query as a string , It may get you used to ORM Developers feel outdated . Use CubicWeb There are other obstacles . First , Setup can be cumbersome . Another potential problem is the lack of a native template engine ; Generate HTML Leave it to the developers .CubicWeb Support Python 3, but Twisted The module itself is not fully transplanted .

32. Zope2 frame

Officer, network :

https://zope.readthedocs.io/en/latest/

optimal spot :Zope 2 It's based on Python Of Web Application framework , It's all Python Web Applications 、 The ancestor of tools , yes Python A powerful branch of the family .Zope 2 Of “ Object Publishing ” The system is very suitable for object-oriented development method , And it can reduce the learning curve of developers , It can also help you find some bad functions in the application .

Lack of spot :Zope Not applicable to simple RESTful API( Every time Bottle or Flask), It doesn't even apply to basic interactive websites (à la Django), because Zope The size and complexity of , Installation requires some work ; This is not a simple matter of extracting the source into a project subfolder .

33. Web2py frame

Officer, network :

http://web2py.com/

optimal spot :Web2py It's a use. Python Free open source written in Web frame , Aimed at agile and rapid development Web application , With fast 、 Scalable 、 Secure and portable database driven applications , follow LGPLv3 Open source licenses .Web2py Provide a one-stop solution , The whole development process can be carried out on the browser , Provides Web Online development of version ,HTML Template writing , Upload of static files , The function of compiling database . Other functions include logging , And an automated admin Interface .

Lack of spot :Web2py An important limitation of is that it is only related to Python 2.x compatible . First , It means Web2py Can't use Python 3 Asynchronous syntax for . If you rely on Python 3 Unique external library , Then you're out of luck . however , Is developing to make Web2py Python 3 Compatible work , And at the time of writing, it's almost complete

34. Pylons frame

Officer, network :

https://docs.pylonsproject.org/projects/pylons-webframework/en/latest/

optimal spot :Pylons Is an open source Web Application framework , Use python Language writing . It's right WSGI The standard has been extended and applied , It improves reusability and divides functions into independent modules .Pylons Is the latest Web Typical in the application framework , Be similar to Django and TurboGears.Pylons suffer Ruby on Rails The impact is deep : Its two components ,Routes and WebHelpers yes Rails Characteristic Python Realization .

Lack of spot :Pylons Already with repoze.bfg Merge , Now in maintenance only mode . It is strongly recommended that new projects be merged from the new Web Frame pyramid start .

35. Cubes frame

Officer, network :

https://pythonhosted.org/cubes/

optimal spot :Cubes It's a lightweight Python Framework and toolset , For developing reporting and analysis applications 、 On line analytical processing (OLAP)、 Multidimensional analysis and browsing of aggregated data . It is Data Brewery Part of .

shortcoming : Implicit aggregation is no longer provided for each cube record_count. It must be clearly defined as aggregation : The old back-end architecture was limited . It allows only one store , You must know the model before the server starts , It is not possible to obtain models from remote sources .

36. Dpark frame

Officer, network :

https://github.com/Liangchengdeye/Dpark

optimal spot :DPark yes Spark Of Python Clone version , It's a Python Implementation of distributed computing framework , It is very convenient to realize large-scale data processing and iterative calculation with low delay . The calculation framework is similar to MapReduce, But more flexible than that , It can be used Python Very convenient for Distributed Computing , And it provides more functions , For better iterative calculation .DPark It is developed, implemented and maintained by domestic Douban company , According to the description of Douban company , At present, the vast majority of data analysis within Douban company uses DPark complete , The whole project is also improving .

Lack of spot :Dpark Using processes , stay Python in , because GIL (Global Interpreter Lock) The existence of , Even if you use multiple threads on a multi-core machine , There is no way to truly implement concurrent execution between these threads .

37. Buildbot frame

Officer, network :

https://buildbot.python.org/all/#/

optimal spot :Buildbot yes python Open source continuous build and continuous delivery tool , by Python, Mozilla, Chromium, WebKit And other well-known projects .Buildbot You can use it directly python package , Easily own tens of thousands of Libraries , Have a strong ability to expand . If you think Jenkins Has easily met your needs , You don't need to Buildbot. If you are in the Jenkins Feel inefficient when 、 Extend the difficult 、 Some use python The actions that can be implemented by scripts are Jenkins The difficulties , Then you can have a look at Buildbot.

Lack of spot :buildbot Support for multiple projects is not good .


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved