Sitemap generator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.3 KiB

4 years ago
  1. pysitemap
  2. =========
  3. Sitemap generator
  4. installing
  5. ----------
  6. ::
  7. pip install sitemap-generator
  8. requirements
  9. ------------
  10. ::
  11. asyncio
  12. aiofile
  13. aiohttp
  14. example
  15. -------
  16. ::
  17. import sys
  18. import logging
  19. from pysitemap import crawler
  20. if __name__ == '__main__':
  21. if '--iocp' in sys.argv:
  22. from asyncio import events, windows_events
  23. sys.argv.remove('--iocp')
  24. logging.info('using iocp')
  25. el = windows_events.ProactorEventLoop()
  26. events.set_event_loop(el)
  27. # root_url = sys.argv[1]
  28. root_url = 'https://www.haikson.com'
  29. crawler(root_url, out_file='sitemap.xml')
  30. TODO
  31. -----
  32. - big sites with count of pages more then 100K will use more then 100MB
  33. memory. Move queue and done lists into database. Write Queue and Done
  34. backend classes based on
  35. - Lists
  36. - SQLite database
  37. - Redis
  38. - Write api for extending by user backends
  39. changelog
  40. ---------
  41. v. 0.9.1
  42. ''''''''
  43. - extended readme
  44. - docstrings and code commentaries
  45. v. 0.9.0
  46. ''''''''
  47. - since this version package supports only python version >=3.7
  48. - all functions recreated but api saved. If You use this package, then
  49. just update it, install requirements and run process
  50. - all requests works asynchronously