{"id":47849,"date":"2017-03-14T08:34:18","date_gmt":"2017-03-13T23:34:18","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=47849"},"modified":"2017-03-14T08:34:18","modified_gmt":"2017-03-13T23:34:18","slug":"pagen","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/pagen\/","title":{"rendered":"pagan - \u30ca\u30fc\u30c9\u306e\u305f\u3081\u306ePython\u88fd\u30a2\u30d0\u30bf\u30fc\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u30fc"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2017\/03\/Is_20170309_210144.jpg\" alt=\"S 20170309 210144\" title=\"s_20170309_210144.jpg\" border=\"0\" width=\"1003\" height=\"607\" \/><\/p>\n<p>Python\u88fd\u306e\u30a2\u30d0\u30bf\u30fc\u5236\u4f5c\u30c4\u30fc\u30eb\u300c<a href=\"https:\/\/github.com\/daboth\/pagan\">pagan<\/a>\u300d\u3002\u53e4\u304d\u826f\u304d\u30c9\u30c3\u30c8\u7d75\u98a8\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b<a href=\"https:\/\/ja.wikipedia.org\/wiki\/%E3%83%8A%E3%83%BC%E3%83%89\">\u30ca\u30fc\u30c9<\/a>\u306e\u305f\u3081\u306e\u30a2\u30d0\u30bf\u30fc\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u30fc\u3067\u3059\u3002<\/p>\n<p>\u6587\u5b57\u5217\u306b\u5bfe\u5fdc\u3057\u305f\u30e6\u30cb\u30fc\u30af\u306a\u30a2\u30d0\u30bf\u30fc\u753b\u50cf\u3092\u4f5c\u6210\u3067\u304d\u308b\u305f\u3081\u3001SNS\u3084Web\u30b5\u30a4\u30c8\u3067\u500b\u4eba\u3092\u8b58\u5225\u3059\u308b\u305f\u3081\u306e\u30a4\u30e1\u30fc\u30b8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>pagan\u306f\u4ee5\u4e0b\u306e\u7279\u5fb4\u3092\u6301\u3063\u3066\u3044\u307e\u3059:<\/p>\n<ul>\n<li>\u6587\u5b57\u5217\u3092\u4e0e\u3048\u3089\u308c\u308b\u3068\u56fa\u6709\u306e\u8272\u3068\u88c5\u5099\u3092\u6301\u3064\u30a2\u30a4\u30b3\u30f3\u3092\u4f5c\u6210<\/li>\n<li>Python\u306ehashlib\u306b\u542b\u307e\u308c\u308b\u30cf\u30c3\u30b7\u30e5\u95a2\u6570\u3092\u9078\u629e\u53ef\u80fd<\/li>\n<li>\u6307\u5b9a\u3055\u308c\u305f\u89e3\u50cf\u5ea6\u306e\u30a2\u30d0\u30bf\u30fc\u30a4\u30e1\u30fc\u30b8\u3092\u751f\u6210\u3067\u304d\u308b<\/li>\n<li>\u4eee\u60f3\u7684\u306a16x16\u30d4\u30af\u30bb\u30eb\u3092\u5b9f\u753b\u50cf\u30b5\u30a4\u30ba\u306b\u30de\u30c3\u30d7\u3059\u308b<\/li>\n<li>\u65b0\u305f\u306a\u6b66\u5668\u3084\u88c5\u5099\u3092\u8ffd\u52a0\u3057\u3066\u62e1\u5f35\u3067\u304d\u308b<\/li>\n<li>\u30ce\u30b9\u30bf\u30eb\u30b8\u30fc\u306b\u6d78\u308b\u3053\u3068\u3082\u3067\u304d\u308b\uff01<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u4f7f\u7528\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>pagan\u306e\u4f7f\u7528\u6cd5<\/h2>\n<p>Python\u88fd\u306e\u30c4\u30fc\u30eb\u306a\u306e\u3067pip\u3092\u4f7f\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306e\u304c\u7c21\u5358\u3067\u3059\u3002<\/p>\n<pre>\npip install pagan\n<\/pre>\n<p>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u547c\u3073\u51fa\u3059\u5834\u5408\u3001\u300cpip \u6587\u5b57\u5217\u300d\u5f62\u5f0f\u3067\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre>\npip hello\npip softantenna\npop src256\n<\/pre>\n<p>\u57fa\u672c\u306f\u3053\u308c\u3060\u3051\u3067\u3059\u304c\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4e0e\u3048\u3066\u51fa\u529b\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u305f\u308a\u3001\u30cf\u30c3\u30b7\u30e5\u95a2\u6570\u3092\u6307\u5b9a\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2017\/03\/Is_20170309_210456.jpg\" alt=\"S 20170309 210456\" title=\"s_20170309_210456.jpg\" border=\"0\" width=\"1048\" height=\"631\" \/><\/p>\n<p>\u307e\u305f\u6a5f\u80fd\u306f\u30e9\u30a4\u30d6\u30e9\u30ea\u5316\u3055\u308c\u3066\u3044\u308b\u305f\u3081Python\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u5185\u304b\u3089\u547c\u3073\u51fa\u3059\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"python\"># Import the pagan module.\nimport pagan\n\n# Acquire an arbitrary string.\ninpt = 'pagan'\n\n# Use pagan to generate the avatar object based on that input.\n# Optional: You can choose which hash function should be used.\n# The functions are available as constants.\n# Default: MD5.\nimg = pagan.Avatar(inpt, pagan.SHA512)\n\n# Open the avatar image in an\n# external image viewer.\nimg.show()\n\n# Set an output path and a file name.\n# You don't need to specify a file ending.\n# Choose a path depending on your OS.\noutpath = 'output\/'\nfilename = inpt\n\n# Saves the avatar image as a .png file\n# by omitting the path and name. The\n# file endings will be generated automatically.\nimg.save(outpath, filename)\n\n# You can change the avatar input and\n# hash function anytime.\nimg.change('new input', pagan.SHA256)\n<\/code><\/pre>\n<p>\u8a73\u7d30\u306f\u516c\u5f0f\u30b5\u30a4\u30c8\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>pagan\u3092\u5229\u7528\u3059\u308c\u3070\u6587\u5b57\u5217\u306b\u5bfe\u5fdc\u3057\u305f\u30e6\u30cb\u30fc\u30af\u306a\u30a2\u30a4\u30b3\u30f3\u753b\u50cf\u3092\u7c21\u5358\u306b\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002Python\u3067Web\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u6210\u3057\u305f\u969b\u3001\u3064\u307e\u3089\u306a\u3044\u30c7\u30d5\u30a9\u30eb\u30c8\u30a2\u30a4\u30b3\u30f3\u3067\u306f\u306a\u304f\u3001\u4f55\u304b\u7279\u5fb4\u306e\u3042\u308b\u753b\u50cf\u3092\u81ea\u52d5\u7684\u306b\u30e6\u30fc\u30b6\u30fc\u306b\u5272\u308a\u5f53\u3066\u305f\u3044\u5834\u5408\u3001\u4fbf\u5229\u306b\u4f7f\u3048\u305d\u3046\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python\u88fd\u306e\u30a2\u30d0\u30bf\u30fc\u5236\u4f5c\u30c4\u30fc\u30eb\u300cpagan\u300d\u3002\u53e4\u304d\u826f\u304d\u30c9\u30c3\u30c8\u7d75\u98a8\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30ca\u30fc\u30c9\u306e\u305f\u3081\u306e\u30a2\u30d0\u30bf\u30fc\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u30fc\u3067\u3059\u3002 \u6587\u5b57\u5217\u306b\u5bfe\u5fdc\u3057\u305f\u30e6\u30cb\u30fc\u30af\u306a\u30a2\u30d0\u30bf\u30fc\u753b\u50cf\u3092\u4f5c\u6210\u3067\u304d\u308b\u305f\u3081\u3001SNS\u3084Web\u30b5 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":47945,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[3459],"tags":[703],"class_list":["post-47849","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-review","tag-python"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/47849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=47849"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/47849\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/47945"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=47849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=47849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=47849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}